How do I detect changes made by a trigger on a single row using the OracleDataApdater
Im updateing a single row of data using the OracleDataAdapter and datatable. Calling the .update method of the apdapter works fine however a database trigger updates one of the field values after the update. This causes me the problem where the datatable is out of sync with the database.
Possible Solutions I could requery the data after each update statement or use oracle dependency fires however I believe that the best method would be to have the DataTable update itself to that of the changed values, but how do I do this? I have tried using usi开发者_Python百科ng the oracle command builder for the update statement and then alter each of the parameters to be inputoutput, this has not worked i have also tried hooking into the events of RowUpdated but unsure as to what to look at there.
Any Suggestions?
Two Ways i Can think of
1- Either start maintaing history of table changes so that , you can query your history table for update mades.
2- Maintain a timestamp column so that when you are going to update the record , you can match the timestamp of records to check whether the record you are updating is stale or not if its stale either throw Concurrency exception or reload the data.
精彩评论