Exception when using OraCommandBuilder after fetching Command
I've written a simple program the fetches data into a DataSet, updates the data and uses a CommandBuilder to write the changes back to the database. Works fine. If, before calling DataAdapter.Update, I use the GetUpdateCommand to get fetch the UpdateCommand (I did this for diagnostic purposes), the DataAdapter.Update now fails with a "ConcurrencyViolation: the UpdateCommand affected 0 rows". Why? I might want to change the UpdateCommand but retain the builder's Insert and Delete commands, but it doesn't look like I can fetch the UpdateCommand.
DataSet ds = new DataSet();
OraDataAdapter da = new OraDataAdapter("select * from emp", "myconnectstring");
da.Fill(ds, "emp");
// update ds here omitted
OraCommandBuilder bld = new OraCommandBuilder(da);
// if I uncomment the next line Update fails
// without it, Update works
//da.UpdateCommand = bld.GetUpdateComamnd();
da.Update(ds, "emp");
Bob Beauchemin
bobb@develop.com