简体   繁体   中英

Connect to PostgreSQL db with ado.net classes

so basically I am trying to connect to PostgreSQL based DB from .NET application with the connection string looking like this

Data Source=localhost;port=5432;Initial Catalog=testDB;User Id=postgres;Password=mypassword

and I am getting this error

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

is there something wrong with my connection string ?

This is typically a problem of having the wrong driver installed, in particular confusion between the 32-bit and 64-bit drivers. Check to see which driver you have installed.

You may also try to set the Run64BitRuntime project setting to False if you have the 32-bit driver installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM