O'Reilly logo

Sams Teach Yourself ADO.NET in 24 Hours by Paul Bertucci, Jason Lefebvre

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required