Darshana Bachankar
asked on
I want to display rows in ascending order in grid view after clicking on button. code has no error but not displaying rows in ascending order.
I want to display rows in ascending order in grid view after clicking on button. here is the code. code has no error but not displaying rows in ascending order.
protected void Button2_Click(object sender, EventArgs e)
{
try
{
DataTable dt = new DataTable();
Dbconn.Open();
string str = "select id,dte from test order by id asc";
oda = new OracleDataAdapter(str, Dbconn);
oda.Fill(dt);
GridView1.DataBind();
}
catch (Exception ex)
{
}
}
protected void Button2_Click(object sender, EventArgs e)
{
try
{
DataTable dt = new DataTable();
Dbconn.Open();
string str = "select id,dte from test order by id asc";
oda = new OracleDataAdapter(str, Dbconn);
oda.Fill(dt);
GridView1.DataBind();
}
catch (Exception ex)
{
}
}
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Here's an example https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sorting(v=vs.110).aspx