这个问题似乎很常见,我已经阅读了这个答案。
不幸的是,我的页面仍然没有分页。以下是我的C#代码:
很抱歉,当我这样做时,我的分页没有显示出来。我做错了什么吗?
谢谢。
不幸的是,我的页面仍然没有分页。以下是我的C#代码:
SqlCommand command = new SqlCommand("(SELECT ......", Connection);
SqlDataAdapter myAdapter = new SqlDataAdapter(command);
DataTable dt = new DataTable();
myAdapter.Fill(dt);
command.Connection = connection;
command.Connection.Open();
GridView1.DataSource = dt;
GridView1.DataBind();
GridView1.AllowPaging = true;
GridView1.PageSize = 15;
command.Connection.Close();
command.Connection.Dispose();
很抱歉,当我这样做时,我的分页没有显示出来。我做错了什么吗?
谢谢。