title: C# Updating a MySQL table when editing a datagrid doesn't work
body: <p>I'm making a small simple program that shows a mysql table in a datagridview and that saves the data back in the table after editing it in the datagridview itself when pressing a button.</p>
  
  <p>The "filling" of the datagrid view with the mysql table works perfectly.
  But I'm getting an error at the "update line" when pressing the save button.
  error: An unhandled exception of type 'System.InvalidOperationException' occurred in System.Data.dll</p>
  
  <p>The code used to fill in the datagridview:</p>
  
  <pre><code> private void roster_Load(object sender, EventArgs e)
      {
          db_connection();
          mySqlDataAdapter = new MySqlDataAdapter("select * from members", connect);
          DS = new DataSet();
          mySqlDataAdapter.Fill(DS);
          dataGridView1.DataSource = DS.Tables[0];
  
      }
  </code></pre>
  
  <p>and the code when pressing the save button:0</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
          {
              db_connection();
              mySqlDataAdapter.Update(DS.Tables[0]);
          }
  </code></pre>
  
  <p>Can anyone help me figure out why it's failing ?</p>
  
  <p>Thanks in advance.</p>