我正在使用数据表将数据绑定到 gridview。我想允许分页。如何进行分页?这是我使用的代码。
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();