System.Data.OleDb Namespace OleDbConnection Class
Initializes a new instance of the OleDbConnection class.
1. Initializes a new instance of the OleDbConnection class.
2. Initializes a new instance of the OleDbConnection class with the specified ConnectionString.
The following example initializes and opens an OleDbConnection with the given connection string.
NOTE: This example uses one of the overloaded versions of the OleDbConnection constructor. For other examples that may be available, see the individual overload topics.
string connString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=myData.mdb"
OleDbConnection myConn = new OleDbConnection ( connString );
myConn.Open ( );
Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=myData.mdb"
Dim myConn As New OleDbConnection ( connString )
myConn.Open ( ) |
|
C# |
VB |
OleDbConnection Members ConnectionString Connecting to a Database