高效率分页
1.row_number()取得结果集的行数;select id,name,age,row_number()over(order by id) from T_table;
2.GetPageData方法取得选择的行数,主要有两个参数(这两个参数的名字不能变),startRowIndex和maximumRows;select * from(select id,name,age,row_number()over(order by id)rowNum from T_table)t where t.rowNum>@startRowIndex and t.rowNum<=@maximumRows+@startRowIndex;
3.QueryCount方法取得总数据;
4.创建正常的ObjectDataSource和ListView;
5.修改EnablePaging="true";SelectCountMethod="QueryCount";SelectMethod="GetPageData";
1.row_number()取得结果集的行数;select id,name,age,row_number()over(order by id) from T_table;
2.GetPageData方法取得选择的行数,主要有两个参数(这两个参数的名字不能变),startRowIndex和maximumRows;select * from(select id,name,age,row_number()over(order by id)rowNum from T_table)t where t.rowNum>@startRowIndex and t.rowNum<=@maximumRows+@startRowIndex;
3.QueryCount方法取得总数据;
4.创建正常的ObjectDataSource和ListView;
5.修改EnablePaging="true";SelectCountMethod="QueryCount";SelectMethod="GetPageData";