This System.EventArgs class provides data for event handlers for the RowUpdated event of the DataAdapter. This includes the command that was just completed (Command); any errors that were encountered (Errors); the number of rows that were changed, inserted, or deleted in response to the command (RecordsAffected); the type of SQL statement the command executed (StatementType); and the relevant System.Data.DataRow object (Row). You can set the Status property to System.Data.UpdateStatus.SkipCurrentRow to bypass a row if there was an error. One easy way to determine if an error occurred is simply to check the number of records affected. If this value is 0, the statement did not complete as expected.

Each provider derives a provider-specific version of the RowUpdatedEventArgs class. Although the RowUpdated event is supported by most DataAdapter objects. It isn’t part of any interface or either base class (DataAdapter or System.Data.IDbDataAdapter). Hence, you can’t attach a generic event handler to this event.

public abstract class RowUpdatedEventArgs : EventArgs {

// Protected Constructors

   protected RowUpdatedEventArgs(System.Data.DataRow dataRow, System.Data.IDbCommand command, 

        System.Data.StatementType statementType, DataTableMapping tableMapping);

// Public Instance Properties

   public IDbCommand Command{get; } 

   public Exception Errors{set; get; } 

   public int RecordsAffected{get; } 

   public DataRow Row{get; } 

   public StatementType StatementType{get; } public ...

Get ADO.NET in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.