Day 11. Using Data Readers

for RuBoard

As you learned yesterday , data readers are created using the ExecuteReader method of the command object. The data reader object that is returned implements the IDataReader and, typically, the IDataRecord interfaces to allow access to the data in a forward-only, read-only cursor-style object. As a result, data readers are ideal for scenarios in which you don't need to hold on to or cache the data and simply need to read through it quickly. In this way, data readers also reduce the overhead required because more than one row is never held in memory at any one time.

In today's short lesson, you'll look at the various ways you can work with data readers and how you can use them in your applications. Specifically, you'll focus on

  • The appropriate uses for data readers and how they differ from the DataSet

  • How to traverse a data reader and extract its values

  • How to use a data reader polymorphically in client code

  • How to handle multiple result sets returned from a data store

for RuBoard


Sams Teach Yourself Ado. Net in 21 Days
Sams Teach Yourself ADO.NET in 21 Days
ISBN: 0672323869
EAN: 2147483647
Year: 2002
Pages: 158
Authors: Dan Fox

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