This article has been excerpted from the book "A Programmer's Guide to ADO.NET in C#"
Understanding the ODBC .NET Data provider
The ODBC.NET data provider provides access to ODBC data provider with the help of native ODBC drivers in the same way that the OleDb.NET data provider accesses native OLE DB providers. One of the best things about working with ADO.NET data providers is that all data provider define the similar class hierarchy. The only things you need to change are the classes and the connection string.
Installing the ODBC .NET Data provider
Unlike the SQL and OleDb data providers, the ODBC data provider is an add-on component to the .NET Framework. If the ODBC .NET provider isn't installed on your system, you can download it from the .NET Software Development Kit (SDK) and Visual Studio .NET. You can find the odbc.net data provider on the Microsoft site (http://www.microsoft.com/data). Alternatively, you can find the latest links of the ODBC.NET SDK on C# corner's Downloads section (http://www.csharpcorner.com/downloads.asp).
After installing ODBC.NET, you need to customize the toolbox to add the ODBC data components to it. You can customize the toolbox by right-clicking on the toolbox's Data tab and selecting Customize Toolbox (see Figure 11-1).

Figure 11-1: The Customize ToolBox option
Note: Makes sure the data tab is selected when you select Customize ToolBox. Otherwise new components will be added to the active tab.
Next, you click on the .NET framework Components tab (not the default COM components) and look for ODBC components. Check the appropriate boxes, and click the OK button (see figure 11-2).

Figure 11-2: Adding ODBC components to the project
Next, you need to add a reference to the Microsoft.Data.Odbc.dll assembly using the Project > Add Reference. You can use the Browser button to browse the directory. The Microsoft.Data.Odbc.dll resides in the \Program Files\Microsoft.NET\Odbc.NET directory (see Figure 11-3).






Join the conversation! Your thoughts help the community grow.