且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

超时已过期。操作完成之前超时时间或服务器未响应

更新时间:2023-02-26 16:20:59

应注意 超时属性 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