日期:2014-05-17  浏览次数:20983 次

AspNetPager分页
求帮忙写一个AspNetPager1根据查询条件查询的结果分页的代码例子...
分页

------解决方案--------------------
网上例子已经很多了吧。。。。。  
------解决方案--------------------
   public void BindData()
        {
            string sql = @"select rownum rn,t.* from(
select a.sfzh,a.xm,a.xb,a.ysyj,a.yybf,a.bcffze,a.xskssj,a.xsjzsj,a.yhkh,a.dh,a.dyfesj,b.dwgryljfjs as ylsjje,b.jfssq from sybx a left join
(select * from zgylbx where jfssq='" + DateTime.Now.AddMonths(-1).ToString("yyyyMM") + "') b on a.sfzh=b.sfzh where a.sjqb='" + DateTime.Now.AddMonths(-1).ToString("yyyyMM") + "') t";
            
            BLL bll = new BLL();
            bll.BindingRepeaterWithAspNetPager(AspNetPager1, Repeater1, sql);
        }

------解决方案--------------------
 #region 用aspnetpager控件和repeater控件结合oracle存储过程绑定
        /// <summary>
        /// 用aspnetpager控件和repeater控件结合oracle存储过程绑定
        /// </summary>
        /// <param name="aspnetpager">aspnetpager控件</param>
        /// <param name="bindingtarget">repeater控件</param>
        /// <param name="pagesql">执行的sql语句</param>
        public void BindingRepeaterWithAspNetPager(AspNetPager aspnetpager, Repeater bindingtarget, string pagesql)
        {
            int recordcount = 0;