Hi,
Update your code as below.
foreach (GridViewRow rowItem in GridView1.Rows)
{
CheckBox chk = (CheckBox)(rowItem.FindControl("ch1"));
if (chk != null && chk.Checked)
{
try
{
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();
con.Close();
}
catch
{
}
}
}
Try to debug the code line by line and see the result on each line.
If still you are facing issue then copy the error here.