SQL Server中的超时错误 [英] Timeout Error in SQL server
本文介绍了SQL Server中的超时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在C#控制台应用程序中遇到以下错误,该应用程序在服务器中连续运行。
超时已过期。从池中获取连接之前已经过了超时时间。
这可能是因为所有池连接都在使用中并且达到了最大池大小
我试过设置sqlcmd.CommandTimeout = 120;
请为此错误建议解决方案。
Iam getting the following error in the C# console application which continuously runs in a server.
Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.
This may have occurred because all pooled connections were in use and max pool size was reached
I have tried by setting sqlcmd.CommandTimeout = 120;
Please suggest a solution for this error.
推荐答案
您需要属性 -
连接
对象的ConnectionTimeoutCommandTimeout
是不同的东西!
You need theConnectionTimeout
property of theConnection
object - theCommandTimeout
is something different!
你好
你刚刚添加
command.CommandTimeout = 0; < br $>
快乐编码
谢谢
Abhimanyu Rawat
Hello
you just add
command.CommandTimeout = 0;
happy coding
Thanks
Abhimanyu Rawat
这篇关于SQL Server中的超时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文