|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
OleDBDataAdapter update and getting original DB valuesAfter update some modified data using an OleDBDataAdapter's Update method, if
there are concurrency exceptions, is there any way to get at the values that are currently in the database without having to do another trip to the database or calling OleDBDataAdapter.Fill? I thought that having the adapter's Update command's UpdateRowSource enum set to Both would return the current (in DB) values in the dataset but the dataset only ever seems to have the Original (in the dataset) and Curent (user modified) values. On Tue, 28 Feb 2006 11:22:28 -0800, "Mark Atkinson"
<MarkAtkin***@discussions.microsoft.com> wrote: >After update some modified data using an OleDBDataAdapter's Update method, if Mark,>there are concurrency exceptions, is there any way to get at the values that >are currently in the database without having to do another trip to the >database or calling OleDBDataAdapter.Fill? >I thought that having the adapter's Update command's UpdateRowSource enum >set to Both would return the current (in DB) values in the dataset but the >dataset only ever seems to have the Original (in the dataset) and Curent >(user modified) values. Think of it this way: an UPDATE SQL statement does exactly that - updates the data, but does not return it. So, if you got a concurrency violation during an update, you'll need to execute a SELECT subsequently in order to retrieve the most current data. Obviously, your DataAdpater won't do it for you by default, simply because of the risk of losing your Original data in the dataset. If you're to override this, you'll need to execute a Fill after a concurrency failure. |
|||||||||||||||||||||||