ComponentOne DataObjects for .NET
Handling Errors in Update
DataObjects for .NET (Enterprise Edition) > Updating the Database > Handling Errors in Update

There can be two different kinds of errors during update:

Concurrency Conflicts

Updating a row can fail because another user has changed the same row between the time the row was fetched and the time it is updated. Different applications handle this situation differently, and it does not always represent an error condition. See Handling Concurrency Conflicts for details.

Program and Physical Errors

An update can fail due to a program error, for example, an incorrect DbTableName property setting, or to a physical error, such as failed database connection. In this case, the Update method execution is aborted, the database transaction is rolled back, and an exception is thrown. Before throwing an exception, the AfterUpdate event is fired, giving the developer an opportunity to clean-up whatever resources could be allocated in the BeforeUpdate event. After that, the exception is passed to the client. On the client, it first fires the UpdateError event, the exception is passed to it as the Error argument. In that event, the developer has an opportunity to handle this situation without throwing an exception, by setting the Status argument to Continue or Skip. If the Status argument is left at the default value ErrorsOccurred, then the exception is thrown, aborting the Update method execution. That exception can then be handled the usual way. See Handling Update Errors on the Client for details.