Entity Framework 使用sql语句分页(查询视图)

1、查询视图

				//3、查询视图
var sql = @" SELECT D.*
FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY TestView.B_MemberId ASC ) AS rownum ,
*
FROM TestView
) AS D
WHERE rownum BETWEEN ( @pageIndex - 1 ) * @pageSize + 1
AND @pageIndex * @pageSize
ORDER BY D.B_MemberId ASC";
object[] sqlParameter =
{
new SqlParameter("@pageIndex",pageIndex),
new SqlParameter("@pageSize",pageSize),
};
var list = dataaccess.QueryList<TestView>(sql, sqlParameter);
上一篇:objective c,copy, mutableCopy区别


下一篇:JAVA中AES对称加密和解密以及与Python兼容