System.Data.OleDb Namespace OleDbConnection Class
Initializes a new instance of the OleDbConnection class with the specified ConnectionString.
[ VB ]
Overloads Public Sub New ( _
ByVal connectionString As String _
)
[ C# ]
public OleDbConnection (
string connectionString
);
[ C++ ]
public: OleDbConnection (
String* connectionString
);
[ JScript ]
public function OleDbConnection (
connectionString : String
);
- connectionString
- The connection used to open the SQL Server™ data store.
When an instance of OleDbConnection is created, the following read/write properties are set to initial values, unless they are specifically set using their associated keywords in the ConnectionString property.
You can change the value for these properties only by using the ConnectionString property.
The following example initializes and opens an OleDbConnection using this constructor.
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 OleDbConnection Constructor Overload List