private void SearchData() { try { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConn"].ToString()); con.Open(); SqlDataAdapter ad = new SqlDataAdapter("Select SrNo,Name,Convert(varchar,Birth,103)as Birth ,Age from Rnd", con); DataSet ds = new DataSet(); ad.Fill(ds, "Rnd"); con.Close(); GridView1.DataSource = ds.Tables["Rnd"]; GridView1.DataBind(); } catch (Exception exec) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "alert('" + exec.ToString() + "')", true); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)