DataList详解和分页

发布时间:2011-09-28 23:53:04   来源:文档文库   
字号:
gedDataSource pds = new PagedDataSource(); pds.AllowPaging = true;//设置数据绑定控件启用分页 pds.CurrentPageIndex = CurrentPageIndex;//使用状态保持保存当前页数 pds.DataSource = ItemService.GetItems();//指定数据源 pds.PageSize = this.PageSize;//设置每页记录数 this.PageCount = pds.PageCount;//总页数 this.lbl.text= 第 CurrentPageIndex 页,共 this.PageCount 页; this.datalistItems.DataSource = pds; this.datalistItems.DataBind(); } ******************** 对比:SQL分页每次返回数量少,适合大数据量(百万行)的数据进行分页 PagedDataSource使用比较方便,但一次返回所有数据,一般适合不超过1万行的(与GridView自带分页相似)

本文来源:https://www.2haoxitong.net/k/doc/8511e2679b6648d7c1c746c1.html

《DataList详解和分页.doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式