title: modify data in database C#
body: <p>Hi guys i'm trying to modify a piece of data in my database here is the section of code i'm using.</p>
  
  <pre><code>    private void btnModifyMember_Click(object sender, EventArgs e)
      {
          string memberid = txtMemberID.Text;
          string lastname = txtLastName.Text;
          string firstname = txtFirstName.Text;
          string phone = txtPhoneNumber.Text;
          string email = txtEmail.Text;
  
          string update = "UPDATE [Club_Member] SET [MemberID]=@memberid,[LastName]=@lastname,[FirstName]=@firstname,[Phone]=@phone,[E_mail]=@email";
          OleDbCommand dbCmd = new OleDbCommand(update, dbConn);
          dbCmd.Parameters.AddWithValue("@MemberID", memberid);
          dbCmd.Parameters.AddWithValue("@LastName", lastname);
          dbCmd.Parameters.AddWithValue("@FirstName", firstname);
          dbCmd.Parameters.AddWithValue("@Phone", phone);
          dbCmd.Parameters.AddWithValue("@E_mail", email);
  
          try
          {
              dbCmd.ExecuteNonQuery();
              MessageBox.Show("Update Complete");
          }
          catch (Exception exc)
          {
              MessageBox.Show(exc.Message);
              return;
          }
  
      }
  </code></pre>
  
  <p>So i run debug, i change one of the entries, i hit the modify member button, then i get a messagebox saying "The record cannot be deleted or changed because table 'Property' includes related records" Debug still goes and I don't get any errors.</p>
  
  <p>Thank you.</p>