<pre> protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { try { SqlConnection con = new SqlConnection(@"user id=sa;password=ssa;database=Mohan;data source=PCTH101\PCTH101"); con.Open(); SqlCommand cmd = new SqlCommand("select * from bind", con); cmd.CommandType = CommandType.Text; SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds, "bind"); GridView1.DataSource = ds.Tables["bind"]; ; GridView1.DataBind(); this.GridView1.Visible = true; } catch { Response.Write("<script>alert('No record Found')</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { GridView1.Visible = false; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)