净PostgreSQL的连接字符串 [英] .Net PostgreSQL Connection String
问题描述
我在一个项目中我的工作使用PostgreSQL和查询之一是超时。我需要增加数据库连接超时,但因为我通过一个复杂的包装,以活动记录和NHibernate使用我的DAO,我不能够调整命令对象的超时 - 所以我希望你可以更改超时通过连接字符串。
I am using PostgreSQL in a project I am working on, and one of the queries is timing out. I need to increase the timeout on the database connection, but since I am using my DAO through a complex wrapper to Active Record and NHibernate, I am not able to adjust the timeout of the command object - so I am hoping you can change the timeout through the connection string.
任何想法?
推荐答案
试试这个:
提供商= PostgreSQL的OLE DB提供程序;数据源= myServerAddress;位置= MyDatabase的;用户ID =名为myUsername;密码= MYPASSWORD;超时= 1000;
Provider=PostgreSQL OLE DB Provider;Data Source=myServerAddress;location=myDataBase;User ID=myUsername;password=myPassword;timeout=1000;
只需用你的东西更换明显的部位(名为myUsername,myServerAddress,等...)。
Just replace the obvious parts (myUsername, myServerAddress, etc...) with your stuff.
此外,供大家参考,本网站会给你pretty的地球上的pretty的多,你需要使用它的任何方式多任何数据库连接字符串模板:
Also, for your reference, this site will give you connection string templates for pretty much any database on earth for pretty much any way you need to use it:
http://www.connectionstrings.com
这篇关于净PostgreSQL的连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!