1.   protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
  2.         {
  3.             int index = Convert.ToInt32(e.CommandArgument);
  4.             string sqlQuery = "Update mytable set ID = @ID WHERE No ="+ index;
  5.             GridOpen(sqlQuery);
  6.  
  7.         }
  8.         void GridOpen(string send)
  9.         {
  10.             string con = "conn string";
  11.             using (SqlConnection dataConnection = new SqlConnection(con))
  12.             {
  13.                 using (SqlCommand dataCommand = new SqlCommand(send, dataConnection))
  14.                 {
  15.                     int ld = 121;
  16.                     dataCommand.Parameters.AddWithValue("ID", ld);
  17.                     dataConnection.Open();
  18.                     dataCommand.ExecuteNonQuery();
  19.                     dataConnection.Close();
  20.  
  21.                 }
  22.  
  23.             }
  24.         }