在1.0版的基础上作了以下改进:
示例代码:
//取页码
if (Request.QueryString["page"] != null)
{
_pageindex = Int16.Parse(Request.QueryString["page"]);
}
this.Pager1.CurrentPage = _pageindex;
this.Pager1.Sql = "select subject from documents order by publishdate desc";
this.GridView1.DataSource = this.Pager1.GetDataSource(connectionstring);
this.GridView1.DataBind();
GetDataSource方法有一个重载:
public DataView GetDataSource(string connectionstring)
public DataView GetDataSource(SqlConnection conn)