DB2 Version 10.1 for Linux, UNIX, and Windows

DB2DataAdapter.RowUpdating Event

Occurs during an Update operation before a command is executed against the database.

Namespace:
IBM®.Data.DB2®
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax

[Visual Basic]
Public Event RowUpdating As DB2RowUpdatingEventHandler
[C#]
public event DB2RowUpdatingEventHandler RowUpdating;
[C++]
public: __event DB2RowUpdatingEventHandler* RowUpdating;
[JScript]

In JScript(R), you can handle the events defined by a class, but you cannot declare new events.

Event data

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

Property Description
DB2RowUpdatingEventArgs.Command Gets or sets the DB2Command to to execute when Update is called.
Errors (inherited from RowUpdatingEventArgs) Gets any errors generated by the IBM Data Server Provider for .NET when the Command executes.
Row (inherited from RowUpdatingEventArgs) Gets the DataRow to send through an Update.
StatementType (inherited from RowUpdatingEventArgs) Gets the type of SQL statement to execute.
Status (inherited from RowUpdatingEventArgs) Gets the UpdateStatus of the Command.
TableMapping (inherited from RowUpdatingEventArgs) Gets the DataTableMapping to send through the Update.

Remarks

When using the Update method, there are two events that occur per data row updated. The order of execution is as follows:
  1. The values in the DataRow are moved to the parameter values.
  2. The OnRowUpdating event is raised.
  3. The command executes.
  4. If the UpdateRowSource enumeration is set to FirstReturnedRecord, the first returned result is placed in the DataRow.
  5. If there are output parameters, they are placed in the DataRow.
  6. The OnRowUpdated event is raised.
  7. AcceptChanges is called.