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);