ComponentOne DataObjects for .NET
BeforeUpdateRow Event (BaseLogic)

C1.Data.2 Assembly > C1.Data Namespace > BaseLogic Class : BeforeUpdateRow Event
Fired before modifications made to a row are committed to the database.
Syntax
'Declaration
 
Public Event BeforeUpdateRow As RowUpdateEventHandler
public event RowUpdateEventHandler BeforeUpdateRow
Event Data

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

PropertyDescription
For a deleted row, the object representing the SQL DELETE command used to delete the row from the database.  
For an unsuccessful operation, information detailing the error.  
For an added row, the object representing the SQL INSERT command used to add the row to the database.  
The row that is committed to the database.  
For a modified and added row, the object representing the SQL SELELCT command used to refresh the row with database values after the row has been committed to the database.  
Success or failure status of the database access operation. For an unsuccessful operation, specifies the cause of failure.  
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 with all data being updated to the database.  
Returns the table view collection with all data being updated to the database.  
For a modified row, the object representing the SQL UPDATE command used to add the row to the database.  
Remarks
For a bound table, this event can be used to examine and possibly modify the SQL command performing the update.

For an SQL-based table, this event must be used to specify the SQL command performing the update. The IDbCommand object is created and passed as an argument to the event. Event code must set the CommandText property of the command object.

For an unbound table, updating the row must be performed in the event code. C1DataObjects does not create a command object in this case. The result of the update operation must be communicated to C1DataObjects by setting the Status, SqlStatus and Error arguments in the event code.

Although this is less frequently done, the Status, SqlStatus and Error arguments can be changed in event code for bound and SQL-based tables as well as for unbound tables. This too affects the success/failure status of the operations and determines further course of action followed by C1DataObjects.

See Also

Reference

BaseLogic Class
BaseLogic Members
C1TableLogic Class
C1DataSetLogic Class
C1ExpressConnection Class
Events in Updating a Row
Events on Updating Database
Bound, SQL-Based and Unbound Tables