您的位置:首页 > 编程语言 > ASP

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();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: