开发者

Using Where With SubSonic Collection

I am having problem with collection object. Here is the code

CarCollection obj=new CarCollection(); obj.Where("Id","10"); obj.Load();

The problem is the result of the records doubles i.e actually there is only 1 record with the id 10 but it returns 2 same records. Please He开发者_StackOverflowlp me as i am a newbie.

Thanks


You should be able to do this with the following query:

CardCollection cards = new Select()
  .From(Card.Schema)
  .Where(Card.IdColumn).IsEqualTo(10)
  .ExecuteAsCollection<CardCollection>();

I'd suggest you have a look at the query docs to see some examples of SubSonic queries:

http://subsonicproject.com/docs/Simple_Query_Tool

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜