private void Pager(int PageIndex) { int PageSize = 30;
int RecordCount = (int)DBHelper.ExecuteScalar("select count(*)from tArticle"); string sql_list = "select top " + PageSize + " * from tArticle a left join tChannel c on a.subChannelNo= c.subChannelNo and a.mainChannelNo = c.mainChannelNo where a.mainChannelNo=1 and a.subChannelNo=1 and a.articleNo not in (select top " + PageSize * (PageIndex - 1) + " articleNo from tArticle order by articleNo desc) order by a.articleNo desc"; DataTable dt_list = DBHelper.GetDataTable(sql_list);
private void Pager(int PageIndex)
{
int PageSize = 30;
int RecordCount = (int)DBHelper.ExecuteScalar("select count(*)from tArticle"); string sql_list = "select top " + PageSize + " * from tArticle a left join tChannel c on a.subChannelNo= c.subChannelNo and a.mainChannelNo = c.mainChannelNo where a.mainChannelNo=1 and a.subChannelNo=1 and a.articleNo not in (select top " + PageSize * (PageIndex - 1) + " articleNo from tArticle order by articleNo desc) order by a.articleNo desc";
DataTable dt_list = DBHelper.GetDataTable(sql_list);
AspNetPager1.PageSize = PageSize;
AspNetPager1.CurrentPageIndex = PageIndex;
AspNetPager1.RecordCount = RecordCount; rpt_list.DataSource = dt_list;
rpt_list.DataBind();
}
看源 是解决办法最快的 。 看看哪个链接链的是 baidu 不就知道了