foreach (GridViewRow rowI tem in GridView1.Rows) { CheckBox chk = (CheckBox)(rowItem.Cells[7].FindControl("ch1")); try { if (chk == null) { Label3.Text = "hai"; SqlConnection myConnection = new SqlConnection("Data Source=PCIMS051;Initial Catalog=unblockingwebsite;Integrated Security=True"); myConnection.Open(); SqlCommand myCommand = new SqlCommand("INSERT INTO twebsite_unblocking (Requested_Status) " + "Values ('2')", myConnection); myCommand.ExecuteNonQuery(); myConnection.Close(); } } catch { } }
if( myCommand.ExecuteNonQuery() > 0 ) { Response.Write("success"); } else { Response.Write("failed"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)