简体   繁体   English

使用ado.net类连接到PostgreSQL数据库

[英]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 所以基本上我试图从.NET应用程序使用如下所示的连接字符串连接到基于PostgreSQL的数据库

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. 这通常是安装错误驱动程序的问题,尤其是32位和64位驱动程序之间的混淆。 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. 如果安装了32位驱动程序,您也可以尝试将Run64BitRuntime项目设置设置为False。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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