ODBC (Open Database Connectivity)

Though there is no ODBC .NET provider included with the Microsoft .NET Framework SDK, you can download one for free at http://www.microsoft.com/data. You can use this provider to connect to any valid ODBC source. Though ODBC is usually not an optimal choice, if you are unable to find a managed or OLE DB provider for your data source, you most likely will be able to find an ODBC driver.

You can use the following code to create a new instance of the ODBC Connection object:

Dim conn as OdbcConnection = New OdbcConnection("dsn=myDSN;UID=myUid;PWD=;")

The preceding OdbcConnection object is using a DSN (Data Source Name) to connect to the data source. A DSN provides a layer of abstraction in connecting to your ODBC ...

Get Sams Teach Yourself ADO.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.