This documentation is archived and is not being maintained.

IDataReader.RecordsAffected Property

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

[Visual Basic]
ReadOnly Property RecordsAffected As Integer
[C#]
int RecordsAffected {get;}
[C++]
__property int get_RecordsAffected();
[JScript]
function get RecordsAffected() : int;

Property Value

The number of rows changed, inserted, or deleted; 0 if no rows were affected or the statement failed; and -1 for SELECT statements.

Remarks

The RecordsAffected property is not set until all rows are read and you close the IDataReader.

IsClosed and RecordsAffected are the only properties that you can call after the IDataReader is closed.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

IDataReader Interface | IDataReader Members | System.Data Namespace

Show: