I have DataTable object with next data:
Id Value
1 val1
3 val2
2 val3
I’m selecting one row next way:
table.Select("Id=1");
This query gives me row
1 val1
And next I want to take the row next to selected one, i.e. row
3 val2
Can I do this somehow? Is it possible?
Maybe there is something like row’s position in a table, that I can use to select next row by incrementing this value?
DataTable.Rows.IndexOf()is the only thing that I can think of.How:
Example:
Output in Linqpad
Hope that helps