LINQ display row numbers

Posted by timvaines on Stack Overflow See other posts from Stack Overflow or by timvaines
Published on 2010-05-10T09:14:29Z Indexed on 2010/05/10 9:24 UTC
Read the original article Hit count: 128

I simply want to include a row number against the returned results of my query.

I found the following post that describes what I am trying to achieve but gives me an exception

http://vaultofthoughts.net/LINQRowNumberColumn.aspx

"An expression tree may not contain an assignment operator"

In MS SQL I would just use the ROWNUMBER() function, I'm simply looking for the equivalent in LINQ.

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about sql-server-2005