简体   繁体   English

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

[英]Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding

The environments I'm using are: .NET (2.0) and SQL Server 2005. 我使用的环境是:.NET(2.0)和SQL Server 2005。

The scenario: in a .NET form the user gets prompted for two variables that will be provided to a stored procedure in SQL Server. 方案:以.NET形式提示用户输入两个变量,这些变量将提供给SQL Server中的存储过程。 Once the records are returned from the stored procedure, the .NET app will import these records to a .csv file. 从存储过程中返回记录后,.NET应用程序会将这些记录导入到.csv文件中。

The trick here is that the stored procedure is dynamic. 这里的窍门是存储过程是动态的。 The records returned are not always the same columns or populating the same temp table. 返回的记录并不总是相同的列或填充相同的临时表。 The .NET app works when the stored procedure runs in less than 30 secs. 当存储过程运行少于30秒时,.NET应用程序将运行。

I have increase my conn.CommandTimeout = 6000 in my app and I have increase the "remote query connection" in SQL Server to 6000 as well but it's still failing for those variables running longer then 30 secs. 我在我的应用程序中增加了conn.CommandTimeout = 6000 ,在SQL Server中也将“远程查询连接”也增加到6000,但是对于那些运行时间超过30秒的变量仍然失败。

Any suggestions is greatly appreciated. 任何建议,不胜感激。

Thanks Chaydee 谢谢Chaydee

This could be because you are setting the command timeout on the connection instead of the command object itself. 这可能是因为您是在连接上而不是命令对象本身上设置命令超时。 Can't see your code but if you are using a DataReader, DataAdapter etc. try setting CommandTimeout on those objects. 看不到您的代码,但是如果您使用的是DataReader,DataAdapter等,请尝试在这些对象上设置CommandTimeout。 A few other possibilities: 其他一些可能性:

  1. the connection timeout is being exceeded before the query is being run. 在运行查询之前,已超过连接超时。 Not likely, but still, what is the connection timeout? 不太可能,但是连接超时是多少? It should be >= any CommandTimeout. 它应该> =任何CommandTimeout。
  2. the CommandTimeout call is not being executed. CommandTimeout调用未执行。
  3. something else is later overriding the CommandTimeout call. 稍后,其他操作将覆盖CommandTimeout调用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Linq Count() 超时 - 执行超时已过期。 操作完成前超时时间已过或服务器未响应 - Linq Count() timing out -Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding '执行超时已过期。 在操作完成之前超时时间已过或服务器没有响应。 - 'Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.' 让超时过期。 从池中获取连接之前经过的超时时间。 。例外 - Getting Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. .exception 获取超时已过期。 从池中获取连接之前经过的超时时间 - Getting Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool 连接泄漏是否会导致Timeout过期。 从池中获取连接之前是否已经过了超时时间? - Will connection leak might Cause Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool? 未处理的异常:超时已过期。 从池中获取连接之前经过的超时时间 - Unhandled Exception: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool 获取异常超时已过期。 从池中获取连接之前经过的超时时间 - Getting exception Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool 超时时间已到。 从池中获取连接之前经过的超时时间 - Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool 连接超时已过期。 登录后阶段已过的超时时间 - Connection Timeout Expired. The timeout period elapsed during the post-login phase 从池中获取连接之前的超时时间已过 - 但池未满 - The timeout period elapsed prior to obtaining a connection from the pool - but the pool is not full
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM