System.Data.SqlClient.SqlDataReader.RecordsAffected Property

Gets the number of rows changed, inserted, or deleted by execution of the Transact-SQL statement.

Syntax

public override int RecordsAffected { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The SqlDataReader.RecordsAffected property is not set until all rows are read and you close the System.Data.SqlClient.SqlDataReader.

The value of this property is cumulative. For example, if two records are inserted in batch mode, the value of RecordsAffected will be two.

SqlDataReader.IsClosed and SqlDataReader.RecordsAffected are the only properties that you can call after the System.Data.SqlClient.SqlDataReader is closed.

Requirements

Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0