Unable to connect to postgres using 1.1

Posted on 2004-11-29
Last Modified: 2010-05-18
Hi All,
I am trying to connect to postgres from my app using 1.1 but it always throws the error
"ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
the problem is the same code worked when I was using pgAdmin 2. I recently installed PgAdmin III and then the app starts failing to connect to my postgres database. The same is the sample code that I was testing
string sMyConnectionString = "driver={PostgreSQL};Server=;Database=Piba.Net;UID=postgres;PWD=;";
OdbcConnection objLConnection = new OdbcConnection(sMyConnectionString);
catch (Exception ex)


Can anyone help me in solving the problem.

Thanks in advance


Question by:tovvenki
    LVL 8

    Accepted Solution

    I think PgAdmin III changed the name of your datasource. If you in Windows (XP), go to control panel, administrative tools, Data Sources (ODBC), you should change the driver={PostgreSQL} part to the exact name listed there, maybe it is driver={PostgreSQL 3.0} or something.


    LVL 4

    Expert Comment

    Connection string for Core Labs PostgreSQLDirect (.NET):
    "User ID=root; Password=pwd; Host=localhost; Port=5432; Database=testdb;Pooling=true; Min Pool Size=0; Max Pool Size=100; Connection Lifetime=0"
    For more details:

    LVL 21

    Author Comment

    HI All,
    Thanks for your quick replies, in fact Razzie's post was very useful, it was the driver after installing pgAdmin III I have updated the driver and was now able to connect to the postgres server.


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now