开发者

Full text search in Subsonic

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 whe开发者_运维百科re 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


answer is:

return new CodingHorror(string.Format("select * from Product where contains(*, '{0}')", queryString)).ExecuteTypedList<Product>();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜