Friday, April 29, 2011

How to get ODBC connection by name?

Given a User DSN how do I create an ODBC connection to that data source in .Net 3.5?

From stackoverflow
  • Here is a tutorial describing the entire process.

    Basically, you do:

    OdbcConnection connection = new OdbcConnection("DSN=MyDataSourceName");
    
    ojblass : Depending on the driver more parameters may be needed in the connection string
    Reed Copsey : Yes, but the concept works. If the User DSN is completely configured, though, this will often be enough.
    Max Schmeling : Awesome. Thanks Reed. I'll give it a try here in a bit but I'm confident it will work. Thank you for the quick response.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.