Hour 5. Connecting to a Data Source

In Hour 2, you saw how to work with DataSets by creating a few DataTables and manually adding columns and rows. This is a terrific way to learn how DataSets work. However, most often data is retrieved from a database and used to populate a DataSet, automatically creating a copy of the database schema and adding the requested data.

However, before you can retrieve anything from your database using ADO.NET, you must create and open a connection to the database using the Connection object. The Connection object uses a database connection string to locate and connect a data source. The exposed properties and methods of the Connection object have changed very little since the days of ADO 2.6.

This hour discusses ...

Get Sams Teach Yourself ADO.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.