我正在使用数据表将数据绑定到gridview.I想要允许分页。我该如何做分页? 这是我使用的代码。数据表是否支持分页或不分页?
SqlConnection con = new SqlConnection(getconnectionString());
SqlCommand cmd = new SqlCommand("Sps_pagingshow", con);
con.Open();
cmd.CommandType = CommandType.StoredProcedure;
//cmd.Parameters.AddWithValue("@PageIndex", pageIndex);
//cmd.Parameters.AddWithValue("@PageSize", int.Parse(ddlPageSize.SelectedValue));
//cmd.Parameters.Add("@RecordCount", SqlDbType.Int, 4);
//cmd.Parameters["@RecordCount"].Direction = ParameterDirection.Output;
IDataReader idr = cmd.ExecuteReader();
GridView1.DataSource = idr;
GridView1.DataBind();
idr.Close();
con.Close();