none
find in each row of a table RRS feed

  • Question

  • I have a table which had is auto-incremented and i would like to search every record for some values. There is an id 

    column but it's not incremented by one. In a simpler way, i would like to got to every row and get the values i'm interested in but i don't know how to go to the first row then the second row etc... 

    Monday, January 12, 2015 10:34 AM

Answers

  • Hello g90,

    >>but i don't know how to go to the first row then the second row etc...

    For this, my understand is that you want return the result one by one in order according to one column, if I am correct, you could have a try with below query syntax:

    var result = (from t in db.Orders
    
                                      orderby t.TestName
    
                                      select t).Skip(1).Take(1).ToList();
    

    This query would return one record from a collection which is ordered by the TestName column and the returned index is the second position. For the first record one, just remove the Skip() method.

    Regadrs.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, January 13, 2015 8:01 AM
    Moderator