RecordsAffected Property

Syntax:

public int RecordsAffected { get; }

Description:

Type: System.Int32

Gets the number of rows changed, inserted, or deleted. Returns -1 for SELECTED statements. Returns 0 if no rows were affected or the statement failed.

This value is not assigned until all the rows are read and the data reader is closed.

Reference:

For more information, reference MSDN documentation for: System.Data.Common.DbDataReader.RecordsAffected