protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Delete")) { int index = Convert.ToInt32(e.CommandArgument); var id = ((Label)GridView1.Rows[index].Cells[0].FindControl("id")).Text.Trim(); SqlConnection con = new SqlConnection(connstring); string qry = "Delete from ['ISB VAS Nodes$'] where ID = " + id + ""; SqlCommand com = new SqlCommand(qry, con); if (com.ExecuteNonQuery() == 1) { Label2.Text = "Deleted"; binddata(); } else { Label2.Text = "Not Deleted"; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)