Reputation: 783
i have a gridview where i have allowed paging. but when i click second page the gridview disappears here is the c# code :
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
OdbcDataAdapter adpState = new OdbcDataAdapter("SELECT CALL_NO,TDATE,
ID_NO,NAME,CONTACT,DEPARTMENT,ISSUE,STATUS FROM TBL_ITHELPDESK
WHERE (STATUS IS NULL OR STATUS <> 'CLOSED') AND TDATE= TO_DATE('" +
txtDate.Text.ToString().Trim() + "','MM-DD-YYYY')", con1);
DataSet ds = new DataSet();
adpState.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
}
can anyone help to find where i'm going wrong
Upvotes: 4
Views: 125
Reputation: 2938
You have to check multiple things.
Define con1
in a class not in a method, something like that
odbcConnection con = new odbcConnection(ConectionString);
Upvotes: 3