实现分页
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "server=.;database=Shopping;uid=admin;pwd=admin";
SqlDataAdapter da = new SqlDataAdapter("select * from product", conn);
DataSet ds = new DataSet();
da.Fill(ds);
PagedDataSource pgs = new PagedDataSource();
pgs.DataSource = ds.Tables[0].DefaultView;
pgs.AllowPaging = true;
pgs.PageSize = 8;
if (Request["pgs"] == null)
{
pgs.CurrentPageIndex = 0;
}
else
{
pgs.CurrentPageIndex = int.Parse(Request["pgs"].ToString());
}
string result = "";
for (int a = 0; a < pgs.PageCount; a++)
{
if (a != pgs.CurrentPageInd