Chapter 5. Connecting to Databases
The first step in working with a database in ADO .NET is to connect to the database using either the SQL Client or the OleDb Client classes and an OLE DB provider. This chapter is all about how you make that connection. As stated previously, there are two Connection classes, one for the SQL Client and one for the OleDb Client. Each class has roughly parallel sets of properties, methods, and events. The OleDbConnection class is slightly more interesting than the SqlConnection class because it supports more database providers. The SqlConnection class is SQL Server-specific, and because of this, many provider-specific settings are built into it. We will discuss both providers together, and where there are differences ...
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.
Read now
Unlock full access