O'Reilly logo

A Programmer's Guide to .NET by Alexei Fedorov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.5. DataReader class

Earlier in this chapter we defined a DataReader class as one that supports reading a forward-only stream of data rows from a data source. Both managed providers implement the IDataReader interface and inherit the following properties.

  • Depth Returns the level of nesting for the current row as an Integer value.

  • IsClosed This Boolean property indicates whether or not the data reader is closed.

  • RecordsAffected Returns the number of rows (as an Integer value) changed, inserted, or deleted by the execution of the SQL statement. If no rows are affected or the statement fails, this property will be set to 0, and for SELECT statements this property will be set to –1.

OleDbDataReader and SqlDataReader classes also have the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required