Windows 上的 Postgres ODBC 与命名管道连接
我正在使用 c# .NET 开发一个应用程序,该应用程序通过 TCP/IP 和 ODBC 连接到 PostgreSQL 数据库。
可以通过命名管道连接吗?我该怎么办?
我需要修改连接字符串吗?
I'm developing an application in c# .NET that is connected to a PostgreSQL database through TCP/IP with ODBC.
It is possibile to connect through named pipes ? How can i do ?
Do i need to modify connection string ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于本地 PostgreSQL 连接,您可以将以下连接字符串与 Npgsql 结合使用:
NpgsqlConnection conn = new NpgsqlConnection("数据库=数据库名称;用户ID=postgres;密码=mypassword;");
For local PostgreSQL connections you can use the following connection string with Npgsql:
NpgsqlConnection conn = new NpgsqlConnection("Database=DatabaseName;User Id=postgres;Password=mypassword;");
PostgreSQL 不使用也不支持命名管道进行客户端连接。
PostgreSQL does not use or support named pipes for client connections.