May 2010
Intermediate to advanced
1272 pages
61h 18m
English
To establish a connection to a database, you need to create an instance of the SqlConnection class passing the connection string as an argument. Then you invoke the Open method to open the connection so that you can perform your data operations. Finally, you invoke Close to close the connection. The following code, which requires an Imports System.Data.SqlClient directive, demonstrates how you establish a connection to the Northwind database:

Utilizing a Using..End Using block ensures that the connection will be correctly released without the need of invoking Close.
To perform an insert ...
Read now
Unlock full access