U moet SelectCommand
configureren , DeleteCommand
, UpdateCommand
en InsertCommand
eigenschappen van DataAdapter. U mag MySqlCommandBuilder
. gebruiken om drie opdrachtobjecten in te vullen (Selecteren, Verwijderen, Bijwerken).
MySqlConnection connection = new MySqlConnection(MyConString);
string sQuery="Select * from Table";
MySqlDataAdapter myDA = new MySqlDataAdapter(sQuery, connection);
MySqlCommandBuilder cmb = new MySqlCommandBuilder(myDA);
DataTable MyDT = new DataTable()// <- My DataTable
myDA.Fill(MyDT);
//Add new rows or delete/update existing one
//and update the DataTable using
myDA.Update(MyDT);