How to update my database table from my grid? (Almost done--just need a little help.)
Posted on 2005-04-08
I am trying to cascade my delete from the dataset back to the database. Here's my code. What am I leaving out? The row disappears from the datagrid, but it's still in the database.
(Don't worry about the hardocded '2'. That's just there to simply the problem.
Thanks in advance!
string strSQLDelete = "delete from Inventory where ID= 2";
OleDbCommand cmdDelete = new OleDbCommand (strSQLDelete, dbConn);
resultDA.DeleteCommand = cmdDelete;
DataRow rowDel = ds.Tables ["Inventory"].Rows;
resultDA.Update (ds, "Inventory");