title: inserting every row in grideview
body: <p>I am trying to insert every row in the GridView into a table on a click of button. My problem with the code below is that the data was inserted but i cant handle the exception i used this code  </p>
  
  <pre><code>string constring = @"Data Source=WINCTRL-RDJN6O6;Initial Catalog=Care_AlexDemo;Integrated Security=True";
      using (SqlConnection con = new SqlConnection(constring))
      {
          using (SqlCommand cmd = new SqlCommand("INSERT INTO TeseI VALUES(@Emp_name, @Emp_number)", con))
          {
              cmd.Parameters.AddWithValue("@Emp_name", row.Cells["Emp_name"].Value);
              cmd.Parameters.AddWithValue("@Emp_number", row.Cells["Emp_number"].Value);
              con.Open();
              cmd.ExecuteNonQuery();
              con.Close();
          }
      }
  }
  MessageBox.Show("Records inserted.");
  </code></pre>