C H A P T E R  12

Making Connections

Before you can do anything useful with a database, you need to establish a session with the database server. You do this with an object called a connection, which is an instance of a class that implements the System.Data.IDbConnection interface for a specific data provider. In this chapter, you’ll use various data providers to establish connections and look at problems that may arise and how to solve them. In this chapter, we’ll cover the following:

  • Introducing data provider connection classes
  • Connecting to SQL Server with SqlConnection
  • Improving your use of connection objects
  • Connecting to SQL Server with OleDbConnection

Introducing the Data Provider Connection Classes

As you saw in Chapter 10, each ...

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.