asp.net AspNetPager Repeater PagedDataSource 假分页方法适用于小数据量分页
2016-03-10 11:06
846 查看
string sqlString = String.Format("SELECT * FROM V_XSOA_OASEARCH WHERE BT LIKE '%{0}%'",searchName);
DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sqlString);
this.AspNetPager1.RecordCount = dt.Rows.Count;//绑定总数量
this.AspNetPager1.AlwaysShow = true;
//先声明一个分页类对象
PagedDataSource ps = new PagedDataSource();
ps.AllowPaging = true;
ps.PageSize = this.AspNetPager1.PageSize;
ps.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex - 1;
ps.DataSource = dt.DefaultView;
this.rp_sarch.DataSource = ps;
this.rp_sarch.DataBind();
DataTable dt = BP.DA.DBAccess.RunSQLReturnTable(sqlString);
this.AspNetPager1.RecordCount = dt.Rows.Count;//绑定总数量
this.AspNetPager1.AlwaysShow = true;
//先声明一个分页类对象
PagedDataSource ps = new PagedDataSource();
ps.AllowPaging = true;
ps.PageSize = this.AspNetPager1.PageSize;
ps.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex - 1;
ps.DataSource = dt.DefaultView;
this.rp_sarch.DataSource = ps;
this.rp_sarch.DataBind();
相关文章推荐
- iReport+JasperReport实现数据库记录导出到pdf文档
- ASP.NET的三层架构(DAL,BLL,UI)
- ASP.NET学习资料
- asp.net框架
- 【项目异常】nested exception is java.lang.NoClassDefFoundError: org/aspectj/util
- aspectjrt 面向切面,拦截返回值,并修改返回值
- Spring学习笔记十四---AspectJ前置通知后置通知
- Spring学习笔记十四---AspectJ返回通知,异常通知,环绕通知
- Spring学习笔记十四--Aspect切面优先级
- Spring学习笔记十四--AspectJ重用切点表达式
- 七天学会ASP.NET MVC(1-3)源代码下载
- asp.net 防止SQL注入攻击
- ASP Girdview通过ButtonField获取行号与主键
- 用asp.net c# HttpWebRequest获取网页源代码
- ASP.NET MVC5 视图预编译
- Asp.Net MVC EF各版本区别
- casperjs在windows下抓取元素乱码
- 树莓派折腾录一. 必要的初始化(Raspberry Pi 2 model B + raspbian jessie)
- ASP.NET验证控件详解
- ASP.NET MVC ajax数组,模型绑定问题。