protected void btnSubmit_Click(object sender, EventArgs e) { string s="select * from items"; SqlDataAdapter da = new SqlDataAdapter(s,con); DataTable dt = new DataTable(); da.Fill(dt); Session["a"]=dt; Response.Redirect("Default2.aspx"); }
protected void Page_Load(object sender, EventArgs e) { DataTable dt=(DataTable)Session["a"]; GridView1.DataSource = dt; GridView1.DataBind(); }
pre
dt.DefaultView.Sort = "YourColumnName ASC"; // DESC for descending.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)