Get the next and previous sql row by Id and Name, EF?

eremejar

New Member
Assume we have the following data in a SQL Server table (sorted by name) :\[code\]Id Name LName-------------------------5 Abbas Dayyan3 Mohammad KD4 Nima Ahmad1 Omid Zangene2 Pedram Ahmadi\[/code\]we have an Id query string and we wanna get the next and previous row (if exists) from Id.e.g :the Id query string is 4, so we wanna get Mohammad KD as previous row and Omid Zangene as next row.Could you please guide me how can do it with Linq to Entity Framework.
 
Back
Top