![](/img/trans.png)
[英]Linq Count() timing out -Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding
[英]Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
我使用的环境是:.NET(2.0)和SQL Server 2005。
方案:以.NET形式提示用户输入两个变量,这些变量将提供给SQL Server中的存储过程。 从存储过程中返回记录后,.NET应用程序会将这些记录导入到.csv
文件中。
这里的窍门是存储过程是动态的。 返回的记录并不总是相同的列或填充相同的临时表。 当存储过程运行少于30秒时,.NET应用程序将运行。
我在我的应用程序中增加了conn.CommandTimeout = 6000
,在SQL Server中也将“远程查询连接”也增加到6000,但是对于那些运行时间超过30秒的变量仍然失败。
任何建议,不胜感激。
谢谢Chaydee
这可能是因为您是在连接上而不是命令对象本身上设置命令超时。 看不到您的代码,但是如果您使用的是DataReader,DataAdapter等,请尝试在这些对象上设置CommandTimeout。 其他一些可能性:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.