Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Exception when using OraCommandBuilder after fetching Command

175289Jul 2 2002
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



Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 31 2002
Added on Jul 2 2002
1 comment
183 views