Please read chapter 19 and complete the example before reading this lesson. The book shows one way to use ADO.NET. Emphasis: "one way".
How often does .NET only have one way to do things?
There are, in fact, a lot of objects in the ADO.NET namespace. They're roughly split into two groups:
- content components
- managed-provider components
The content components essentially hold actual data and include these classes:
- DataSet
- DataTable
- DataView
- DataRow
- DataColumn
- DataRelation
The managed-provider components interact with the database for data retrievals and updates. These components include:
- connection
- command
- data adapter
- data reader
These names are "generic" because unique managed-provider components are used with different databases). There are two that are currently automatically included with ADO.NET: SqlClient is used with Microsoft's SQL Server database and OleDb for everything else.
For example, SqlClient contains SqlDataReader and OleDb contains OleDbDataReader . And more recently, Microsoft has supplied one just for Oracle. But there are a lot of providers available from third party software companies:
- DataDirect Connect for .NET
100% Managed .NET Data Providers for Oracle DB2 Microsoft SQL Server Sybase - UniDirect .NET Data Provider
"Universal access to most major database servers such as Microsoft SQL Server, Microsoft Access, Oracle, DB2, MySQL, PostgreSQL and others"
Even the open source Mono Project has a whole catalog of ADO.NET providers.

