tags:

views:

155

answers:

1

Hi everyone,

In subsonic v2 I can use inline query for full text search in sql server 2008, like this:

DB.Query().ExecuteTypedList<Product>("select * from Product where contains(*, @order)", queryString);

all this works fine.

But now I would like to move on subsonic v3, so I'm trying to get results through SqlQuery, but ExecuteTypedList return an null reference exception:

        SubSonic.Query.SqlQuery inlineQuery = new SqlQuery();
        inlineQuery.SQLCommand = string.Format("select * from Product where contains(*, '{0}')", queryString);
        return inlineQuery.From("Product").ExecuteTypedList<Product>();

PLease prompt me? how I can execute inline query in subsonic v3, to get List<> not a reader

+2  A: 

answer is:

return new CodingHorror(string.Format("select * from Product where contains(*, '{0}')", queryString)).ExecuteTypedList<Product>();
You gotta love Rob for it's intuitive method names :P ... they make allot of sense, if you happen to read some "unnamed" blogs.
Pop Catalin