C H A P T E R  14

Using Data Readers

In Chapter 13, you used data readers to retrieve data from a multirow result set. In this chapter, we’ll look at data readers in more detail. You’ll see how they’re used and their importance in ADO.NET programming.

In this chapter, we’ll cover the following:

  • Understanding data readers in general
  • Getting data about data
  • Getting data about tables
  • Using multiple result sets with a data reader

Understanding Data Readers in General

The third component of a data provider, after connections and commands, is the data reader. Once you’ve connected to a database and queried it, you need some way to access the result set. This is where the data reader comes in.

Data readers are objects that implement the System.Data.IDataReader ...

Get Beginning C# 5.0 Databases, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.