Thread: .Net Development Issues

.Net Development Issues

From
"Peck, Brian"
Date:

Hey all,

Im trying to set up an ODBC connection inside Visual Studio 2005 and getting the error message [Microsoft ODBC Driver Manager] Data source name not found and no default driver specified

The confusing part about that message is I already have the ODBC drivers installed and have been connecting to the Database through the same program when run on the command line. But when we brought it into VS2005 it (at run time) wont connect to the DB.

The string being used is DRIVER={PostgreSQL Unicode};SERVER=localhost;DATABASE=ASDFS;UID=peckb1;PWD=**;Dsn=PostgreSQL30W (I replaced the actual password with **, but the real password is supplied in the string.

Anyone have any ideas on how to get it to work inside VS2005? We are mainly doing this for the ability to have a graphical IDE for debugging.

We are using PostgreSQL 8.2.4.

- Brian Peck

- 858-795-1398

- Software Engineer

- Lockheed Martin

Re: .Net Development Issues

From
g weaver
Date:


 "Peck, Brian" on  February 11, 2008 1:31 pm
Confronted some .Net Development Issues

> Hey all,
>
> I'm trying to set up an ODBC connection inside Visual Studio
> 2005 and
> getting the error message "[Microsoft ODBC Driver Manager] Data source
> name not found and no default driver specified"
>
> The confusing part about that message is I already have the ODBC
> driversinstalled and have been connecting to the Database
> through the same
> program when run on the command line. But when we brought it
> into VS2005
> it (at run time) won't connect to the DB.
 
I'm not quite sure what you mean by "at run time".  
 
You can experience this problem if you open a form in the designer and the form's load event triggers an activity that attempts to connnect to your database.  You can avoid this by putting the following as the first line in the form's load event "If DesignMode then Exit Sub".
 
If I haven't interpreted your problem correctly, perhaps you could be a little more specific as to the steps you're taking and when the problem occurs.
 
Regards,
George

>
> The string being used is "DRIVER={PostgreSQL
> Unicode};SERVER=localhost;DATABASE=ASDFS;UID=peckb1;PWD=**;Dsn=PostgreSQ
> L30W" (I replaced the actual password with **, but the real
> password is
> supplied in the string.
>
> Anyone have any ideas on how to get it to work inside VS2005? We are
> mainly doing this for the ability to have a graphical IDE for
> debugging.
> We are using PostgreSQL 8.2.4.