O'Reilly logo

Programming Microsoft® ADO.NET 2.0 Core Reference, 2nd Edition by David Sceppa

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

Connection Strings

The previous code snippets have involved setting the ConnectionString property on SqlConnection objects through that class’s constructor. However, we’ve yet to discuss what a connection string is.

What Is a Connection String?

In the previous code snippets, we supplied a connection string for our new SqlConnection objects. A connection string consists of a series of name-value pairs delimited by semicolons:

strConn = "Setting1=Value1;Setting2=Value2;..."

The settings and values depend on the data source you want to connect to, as well as on the technology you’re using to connect to your data source.

The SQL Client .NET Data Provider is extremely flexible when it comes to connecting to databases, and it provides a variety of ways to ...

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