|
|
Reading rows using a DataReader object (sometimes known as a firehose cursor) is typically faster than reading from a DataSet. DataReader objects are part of the managed providers, and there are three DataReader classes: SqlDataReader, OleDbDataReader, and OdbcDataReader. You use a DataReader object to read rows retrieved from the database using a Command object.
DataReader objects can be used to read rows only in a forward direction. DataReader objects act as an alternative to a DataSet object (DataSet objects allow you to store a copy of the rows from the database, and you can work with that copy while disconnected from the database). You cannot use a DataReader to modify rows in the database.
Featured in this chapter:
The SqlDataReader class
Creating a SqlDataReader object
Reading rows from a SqlDataReader object
Returning strongly typed column values
Reading null values
Executing multiple SQL statements
Using a DataReader object in Visual Studio .NET
|
|