CS 112D Lecture Notes - Data Providers (Chapter 4 part 1)

Namespaces

namespace - a logically related set of classes, functions, subroutines, other namespaces, etc. When specifying a class that's part of a namespace, the namespace must be specified as well, either using an "Imports <namespace>" statement before the class is used, or fully qualifying the class name with <namespace>.class. For example, the SqlConnection class is part of the SqlClient namespace, which is part of the Data namespace, which is part of the System namespace. So there are two wasy to declare a SqlConnection object called "myConnection":
  Dim myConnection As System.Data.SqlClient.SqlConnection
or:
  ' This line should be at the top of your code file:
  Imports System.Data.SqlClient

  ' This line can be anywhere later in the file:
  Dim myConnection As SqlConnection

Overview of ADO.NET

The Connection Classes

Return to the main CS 112D page