如何在ConnectionString中增加CommandTimeOut [英] How to Increase CommandTimeOut In ConnectionString

查看:298
本文介绍了如何在ConnectionString中增加CommandTimeOut的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我面临的问题是超时已过期。在操作完成之前已经过了超时时间,或者服务器没有响应。因此我需要在连接字符串中指定commandtimeout,因为我们使用sqlhelper的第三方dll,我们无法通过代码设置命令超时。

还有一件事是这个问题将在增加后解决连接字符串中的连接超时?

Hi There,

I am facing issue as "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding". So i need to specify commandtimeout in to connection string as we are using third party dll for sqlhelper where we can not set command timeout through the code.
One more thing is this issue will get resolved after increasing the connection timeout in connection string?

推荐答案

正如Tomas Takac所说,连接字符串中的超时仅用于连接过程。



正确的方法是使用 CommandTimeOut [ ^ ]属性。



如果您使用的是Microsoft数据访问应用程序块SqlHelper类,则数据库已成功执行sqlhelper,您可以使用DBCommand.SetCommandTimeout设置命令超时。



如果您使用的是旧版本(即MS DAAB SqlHelper),那么FillDataSet方法会覆盖命令超时参数。



如果您正在使用其他内容,则使用intellisense搜索类似于第3方dll中的commandtimeout或与作者/供应商联系。
As Tomas Takac said, the timeout in the Connection String is for the connection process only.

The correct way woudl be to use the CommandTimeOut[^] property in your code.

If you are using the Microsoft Data Access Application Block SqlHelper class then sqlhelper has been succeeded by DataBase and you can set the command timeout with DBCommand.SetCommandTimeout.

If you are using an older version (i.e. MS DAAB SqlHelper) then there are overrides on the FillDataSet method that take a command timeout parameter.

If you are using something else, then search using intellisense for something similar to "commandtimeout" in your 3rd party dll or contact the author/vendor.


这篇关于如何在ConnectionString中增加CommandTimeOut的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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