.Net PostgreSQL连接字符串 [英] .Net PostgreSQL Connection String

查看:693
本文介绍了.Net PostgreSQL连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我正在开发的项目中使用PostgreSQL,其中一个查询是超时。我需要增加数据库连接的超时,但由于我使用我的DAO通过一个复杂的包装器Active Record和NHibernate,我不能调整命令对象的超时 - 所以我希望你可以更改超时通过连接字符串。



任何想法?

解决方案

>

Provider = PostgreSQL OLE DB Provider; Data Source = myServerAddress; location = myDataBase; User ID = myUsername; password = myPassword; timeout = 1000;



只需用你的东西替换明显的部分(myUsername,myServerAddress等等)。



此外,你连接字符串模板几乎任何数据库在地球上几乎任何你需要使用它:



http://www.connectionstrings.com


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.

Any ideas?

解决方案

Try this one:

Provider=PostgreSQL OLE DB Provider;Data Source=myServerAddress;location=myDataBase;User ID=myUsername;password=myPassword;timeout=1000;

Just replace the obvious parts (myUsername, myServerAddress, etc...) with your stuff.

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

这篇关于.Net PostgreSQL连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆