.NET Framework Data Provider for ODBC
This is a .NET Framework Wrapper Class Library provided by Microsoft.
The wrapper class library is contained in the file System.Data.dll.
The wrapper class library is contained in the file System.Data.dll.
Coding
Add a reference to the assembly System.Data and include the System.Data.Odbc namespace. Instantiate a new OdbcConnection connection object. Set the connection string and open the connection.
VB.NET code sample
C# code sample
VB.NET code sample
Imports System.Data.Odbc
Dim myConnection As OdbcConnection = New OdbcConnection;();
myConnection.ConnectionString = myConnectionString
myConnection.Open()
//execute queries, etc
myConnection.Close()
Dim myConnection As OdbcConnection = New OdbcConnection;();
myConnection.ConnectionString = myConnectionString
myConnection.Open()
//execute queries, etc
myConnection.Close()
C# code sample
using System.Data.Odbc;
OdbcConnection myConnection = new OdbcConnection;();
myConnection.ConnectionString = myConnectionString;
myConnection.Open();
//execute queries, etc
myConnection.Close();
OdbcConnection myConnection = new OdbcConnection;();
myConnection.ConnectionString = myConnectionString;
myConnection.Open();
//execute queries, etc
myConnection.Close();
Description
The .NET Framework Data Provider for ODBC uses native ODBC Driver Manager through COM interop to enable data access. The OdbcConnection wraps/bridges to the underlying driver sprecified in the connection string using the keyword "Driver" or "DSN" (if the connection should obtain its settings from an ODBC DSN). This means that virtually every ODBC driver can be used through this class library. The .NET Framework Data Provider for ODBC supports both local and distributed transactions. For distributed transactions, the .NET Framework Data Provider for ODBC, by default, automatically enlists in a transaction. Depending on the functionality supported by the native ODBC driver, some methods or properties of an OdbcConnection object may not be available.;
More info about this wrapper class library can be found at the Microsoft product page.
Connection Strings
Additional info or comments on this wrapper class library? Want to submit content?
Send an e-mail to
Send an e-mail to

Selected Articles
