title: Deleting row from Data Table bound to a DataGridView -C#
body: <p>I've bound a DataGridView to a MySql table, although I'm having trouble simultaneously deleting a row from the DataGridView control and the MySql table.</p>
  
  <p>Here was my attempt:</p>
  
  <pre><code>    //* I used a class called "mySqlInterface to bind my DataGridView control.
      //* "dataTable" is a DataTable that gets filled by the database table
       private void deleteButton_Click(object sender, EventArgs e)
      {
  
          string accountNum =    clientDGV.SelectedRows[0].Cells[clientDGV.SelectedRows[0].Cells.Count - 1].Value.ToString();
          string selectStr = "account_number = " + accountNum;
          DataRow rowToDelete = mySqlInterface.dataTable.Select(selectStr)[0];
          mySqlInterface.dataTable.Rows.Remove(rowToDelete);
          mySqlInterface.Save(); 
         //Save() executes mySqlDataAdapter.Update(dataTable);
      }
  </code></pre>
  
  <p>This removed the selected row from the DGV, but not from the DB.</p>
  
  <p>Any tips? Thanks guys!</p>