public Datatable fillcity() { SqlConnection con = new SqlConnection(str); SqlCommand cmd = new SqlCommand("sp_fillcity", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count == 0) { Label1.Visible = true; Label1.Text = "No city added till now"; GridView1.Visible = false; } else { Label1.Visible = false; GridView1.Visible = true; GridView1.DataSource = dt; GridView1.DataBind(); } } protected void Button1_Click(object sender, EventArgs e) { fillcity(); }
Join Hands Change lives Thanks & Regards Straight Edge Society
Thanks&Regards:- Shubham Choudhary Software Engineer www.facebook.com/shubham.kunar
Shubham Agrahari
Login to post response