Occurs during Update after a command is executed against the data source. The attempt to update is made, so the event fires.
Assembly: System.Data (in System.Data.dll)
When using Update, there are two events that occur per data row updated. The order of execution is as follows:
The values in the DataRow are moved to the parameter values.
The OnRowUpdating event is raised.
The command executes.
If the command is set to FirstReturnedRecord, the first returned result is placed in the DataRow.
If there are output parameters, they are placed in the DataRow.
The OnRowUpdated event is raised.
AcceptChanges is called.
The following example shows how to use both the RowUpdating and events.
The RowUpdating event returns this output:
event args: (command=System.Data.SqlClient.SqlCommand commandType=2 status=0)
The event returns this output:
event args: (command=System.Data.SqlClient.SqlCommand commandType=2 recordsAffected=1 row=System.Data.DataRow status=0)
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)