ComponentOne DataObjects for .NET
BeforeUpdate Event (C1DataSetLogic)

C1.Data.2 Assembly > C1.Data Namespace > C1DataSetLogic Class : BeforeUpdate Event
Fired before all changes in the data set are updated to the database.
Syntax
'Declaration
 
Public Event BeforeUpdate As DataSetEventHandler
public event DataSetEventHandler BeforeUpdate
Event Data

The event handler receives an argument of type DataSetEventArgs containing data related to this event. The following DataSetEventArgs properties provide information specific to this event.

PropertyDescription
The data set where the event has occurred.  
For an unsuccessful operation, information detailing the error.  
Success or failure status of the operation. In events occurring before operation and allowing to change the status argument, user code can change the status to indicate whether to proceed with the operation, skip or abort it.  
Returns the table collection of the data set. Use this property to gain access to table data in 3-tier configuration, where the DataSet argument is not set because it resides on the client and the event is fired on the server.  
Returns the table view collection of the data set. Use this property to gain access to table view data in 3-tier configuration, where the DataSet argument is not set because it resides on the client and the event is fired on the server.  
Remarks
Before any modified rows are committed to the database, the BeforeUpdate event fires. The DataSet argument contains the data set passed to the server for update. By modifying this data set, you can customize the update process, control the set of rows and field values that undergo database update.

You can even perform the whole update process in your code in the BeforeUpdate event and tell C1DataObjects to skip further processing, consider it done, by setting the Status argument to Skip. If you detect an unrecoverable error in this event, set the Status argument to ErrorsOccurred and set the Error argument to describe the error.

See Also

Reference

C1DataSetLogic Class
C1DataSetLogic Members
C1ExpressConnection Class
Controlling the Update Process