O'Reilly logo

Beginning C# 5.0 Databases, Second Edition by Vidya Vrat Agarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required