Summary

In this chapter, you learned how to use a DataReader object to read results returned from the database. DataReader objects are part of the managed providers, and there are three DataReader classes: SqlDataReader, OleDbDataReader, and OdbcDataReader. You use an object of the SqlDataReader class to read rows retrieved from a SQL Server database; an object of the OleDbDataReader class to read rows from any database that supports OLE DB, such as Oracle or Access; and an object of the OdbcDataReader class to read rows from any database that supports ODBC.

DataReader objects can be used to read rows only in a forward direction, and you cannot use them to modify the database, but they do offer very fast retrieval of rows. 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.




Mastering C# Database Programming
Mastering the SAP Business Information Warehouse: Leveraging the Business Intelligence Capabilities of SAP NetWeaver
ISBN: 0764596373
EAN: 2147483647
Year: 2003
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net