Hi guys,
I am trying to view the list of tables which contains thousand of records to do viewing page every 20 pages and here's what I have been trying
asp.net code
cs code
But I have got an error:
"The data source does not support server-side data paging."
I understand to collect the records from table into list collection first, but how to do dynamic list collection since I have list of many different tables which contains different number of columns?
Any input will be appreciated
I am trying to view the list of tables which contains thousand of records to do viewing page every 20 pages and here's what I have been trying
asp.net code
Code:
<asp:GridView ID="GridRefTable" runat="server" CssClass="mword" EnableViewState ="false" HeaderStyle-CssClass="viewprpstatustablehead"
PagerSettings-Mode="NextPrevious" PageSize ="20" CellSpacing="0" CellPadding="5" PagerSettings-Visible="true" AllowPaging ="true" />
cs code
Code:
private void View_Table()
{
RefTable = DropDownListRefTables.SelectedItem.Value;
SqlConnection conn = new SqlConnection(CONST_CONN);
String sql = "select top 100 * from " + RefTable;
SqlCommand cmd = new SqlCommand(sql, conn);
try
{
if (DropDownListRefTables.SelectedItem.Value == "")
{
LabelRefTable.CssClass = "merror";
LabelRefTable.Text = "Please choose the reference table";
}
else
{
conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
GridRefTable.DataSource = reader;
GridRefTable.DataBind();
reader.Close();
conn.Close();
conn.Dispose();
}
}
catch (Exception ex)
{
LabelRefTable.CssClass = "merror";
LabelRefTable.Text = ex.Message;
}
But I have got an error:
"The data source does not support server-side data paging."
I understand to collect the records from table into list collection first, but how to do dynamic list collection since I have list of many different tables which contains different number of columns?
Any input will be appreciated