I have a table Orders like this:
ID
CustomerID
name
ID CustomerID name 1 4 aa
5 6 bbb
开发者_如何转开发4 9 ccc
8 10 ddd
first ordering the table,then get the next row..... How to do? if current row id is 4 ,i want to get the row where id==5
I think you want this:
Orders.OrderBy(x=>x.ID).Skip(1).Take(1)
Edit: If I understand your question now:
Orders.OrderBy(x=>x.ID).Where(x=>x.ID>4).FirstOrDefault();
精彩评论