public void BindPager() { string sql = "SELECT TOP 1000 [Id] ,[title],[news] ,[time] FROM [Library].[dbo].[Notice]"; //获取查询得到的总条数 this.pager.RecordCount = bll.showNoticeCount(); int pageIndex = this.pager.CurrentPageIndex - 1; //获取当前条数 int pageSize = this.pager.PageSize = 2; //设置每一页显示多少条 repList.DataSource = DAL.SqlHelper.GetCurrentPage(sql, pageIndex, pageSize); repList.DataBind(); }