已有
1,126 位领导视察,其中有
1 位领导做了批示.
在1.0版的基础上作了以下改进:
# 支持将数据源输出。表明你可以将数据控件的DataSource指定为该分页控件。
# 无需指定记录数。记录数在控件中已进行计算。
# 需指定SQL语句。
# 虽然有ExecuteType的枚举,但并未实现,目前只支持ExecuteType.Text的枚举。
示例代码:
//取页码
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)