问题描述
hi我收到一个错误超时已过期。操作完成之前超时时间或服务器未响应
。
我已更改连接 timeout = 60000
并且在数据库中我的过程在43秒内执行。所以plz给我一些完美的解决方案
hi I'm getting an error Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
.
I'm alredy changed the connect timeout = 60000
and in database my procedure is executes in 43sec. so plz give me some perfect solution
谢谢
推荐答案
应注意 SqlConnection
对象和 SqlCommand
对象是不同的属性。
默认命令超时设置为30秒。设置为60,您的问题将解决:
You should note that Timeout
property for SqlConnection
object and Timeout
property for SqlCommand
object are different properties.
By default command timeout is set to 30 seconds. Set it to 60, and your issue will be solved:
commandObject.Timeout = 60;
但最有可能的是你应该更改你的SQL过程或拆分成某些部分
But most likely that you should change your SQL procedure or split it to some parts
这篇关于超时已过期。操作完成之前超时时间或服务器未响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!