protected void Button1_Click1(object sender, EventArgs e) { foreach (GridViewRow gdv in GridView1.Rows) { CheckBox chk = (gdv.Cells[0].FindControl("chkbox1") as CheckBox); if (chk.Checked == true) { var Label = gdv.Cells[0].FindControl("lblid") as Label; SqlConnection cn = new SqlConnection(constr); SqlCommand cmd = new SqlCommand("Delete from tbl_login where Id=@Id", cn); cmd.Parameters.AddWithValue("@Id", int.Parse(Label.Text)); cn.Open(); int id = cmd.ExecuteNonQuery(); cn.Close(); Gridviewdetail(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)