超时已过期.操作完成之前经过的超时时间或服务器没有响应

ame*_*han -1 database sql-server timeout sqlconnection connection-timeout

嗨,我收到了一个错误Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
我已经改变了连接timeout = 60000,在数据库中我的程序在43秒内执行.所以PLZ给了我一些完美的解决方案

谢谢

VMA*_*Atm 18

你应该注意的是Timeout财产SqlConnection对象和Timeout属性SqlCommand对象有不同的属性.
默认情况下,命令超时设置为30秒.将其设置为60,您的问题将得到解决:

commandObject.Timeout = 60;
Run Code Online (Sandbox Code Playgroud)

但最有可能的是,您应该更改SQL过程或将其拆分为某些部分