记录一次在生成数据库服务器上出现The timeout period elapsed prior to completion of the operation or the server is not responding.和Exception has been thrown by the target of an invocation的解决办法

时间:2023-03-10 03:16:01
记录一次在生成数据库服务器上出现The timeout period elapsed prior to completion of the operation or the server is not responding.和Exception has been thrown by the target of an invocation的解决办法

记一次查询超时的解决方案The timeout period elapsed......

https://www.cnblogs.com/wyt007/p/9274613.html

Exception has been thrown by the target of an invocation

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
语句已终止。

问题描述

在数据库中执行查询语句,大约1秒钟查询出来,在C#中用ado进行连接查询,一直等待很久未查出结果,最后抛出查询超时异常。

异常内容如下:

Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

解决方案:

exec sp_updatestats

执行结果:

记录一次在生成数据库服务器上出现The timeout period elapsed prior to completion of the operation or the server is not responding.和Exception has been thrown by the target of an invocation的解决办法

参考文章:

https://*.com/questions/8602395/timeout-expired-the-timeout-period-elapsed-prior-to-completion-of-the-operation

https://docs.microsoft.com/zh-cn/sql/t-sql/statements/update-statistics-transact-sql?view=sql-server-2017