August 2002
Intermediate to advanced
944 pages
22h 32m
English
In the following sections, we’ll use the Northwind database that ships with the .NET Framework SDK. To access this data source, we’ll use the classes from the SqlClient namespace. We’ll highlight any differences between the use of the classes in the SQL and OLE DB libraries where they are relevant.
To connect to a database, you must create a SqlConnection object. The simplest way to do this is to pass a connection string as a parameter to the SqlConnection constructor, as shown here:
String conString = "data source=(LOCAL); initial catalog=Northwind; integrated security=SSPI; persist security info=False; workstation id=(LOCAL);packet size=4096"; SqlConnection con = new SqlConnection(conString); ...
Read now
Unlock full access