I have this exception

Exception of type 'Antlr.Runtime.MismatchedTokenException' was thrown.
near line 1, column 10

in this code (last line)
........................................................
                query = @"select ar.* from MArtist as ar
                                inner join MAlbum as al where ar.Name like 
:artistname and al.Name
like :albumname ";
                SimpleQuery<MArtist> q = new
SimpleQuery<MArtist>(typeof(MArtist), query);
                q.SetParameter("artistname", "%"+ArtistName+"%");
                q.SetParameter("albumname", "%" + AlbumName + "%");
                return q.Execute();
.....................................
but in another query (below) i get my data from table without error
..........................................................
                query = @"from MArtist as ar
                                where ar.Name like :artistname";
                SimpleQuery<MArtist> q = new
SimpleQuery<MArtist>(typeof(MArtist), query);
                q.SetParameter("artistname","%"+ArtistName+"%");
                return q.Execute();
..................................................
may be something wrong with "select" or "join" ?
I also use Castle.ActiveRecord . Relations between classes are:

In MArtist:
        [HasMany(Table = "album", ColumnKey = "idartist", Inverse =
true, Cascade = ManyRelationCascadeEnum.AllDeleteOrphan)]
        public virtual IList<MAlbum> Albums { get; set; }

in MAlbum:
        [BelongsTo("idartist")]
        public virtual MArtist Artist { get; set; }

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to