Skip to Main Content
Pro C# 2010 and the .NET 4 Platform, Fifth Edition
book

Pro C# 2010 and the .NET 4 Platform, Fifth Edition

by Andrew Troelsen
May 2010
Intermediate to advanced content levelIntermediate to advanced
1752 pages
41h 17m
English
Apress
Content preview from Pro C# 2010 and the .NET 4 Platform, Fifth Edition

21.8. Understanding the Connected Layer of ADO.NET

Recall that the connected layer of ADO.NET allows you to interact with a database using the connection, command, and data reader objects of your data provider. You have already used these objects in the previous DataProviderFactory application, now you'll walk through the process again, this time using an expanded example. You need to perform the following steps when you wish to connect to a database and read the records using a data reader object:

  1. Allocate, configure, and open your connection object.

  2. Allocate and configure a command object, specifying the connection object as a constructor argument or with the Connection property.

  3. Call ExecuteReader() on the configured command class.

  4. Process each ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Professional C# 5.0 and .NET 4.5.1

Professional C# 5.0 and .NET 4.5.1

Christian Nagel, Jay Glynn, Morgan Skinner
Visual C++ 2008: How to Program, Second Edition

Visual C++ 2008: How to Program, Second Edition

P. J. Deitel, H. M. Deitel, D. T. Quirk

Publisher Resources

ISBN: 9781430225492Purchase book