我的表由三列组成(sno,name,age).我正在使用额外的列(行号)从数据库中检索此表,并使用以下代码:
select * from (
select ROW_NUMBER() over (order by SNo asc)as rowindex,SNo,Name,Age
from tblExample)
as example where rowindex between ((pageindex*10)+1) and ((pageindex+1)*10)
Run Code Online (Sandbox Code Playgroud)
注意,pageindex是一个变量,它接受用户传递的一些整数值.
我的数据库是Sql Server 2008.我想使用Linq编写相同的查询.我怎么做?