增加.net中的Sql超时

发布于 2024-09-28 17:28:47 字数 152 浏览 0 评论 0原文

我的 .net 服务中出现 SQL 超时错误。

由于该服务已安装在生产环境中,有什么方法可以增加 App.Config 文件中服务的超时时间。

目前,我在一分钟后收到此异常,我必须将其延长到大约 10 小时,因为我们使用的存储过程需要 2-2 小时才能执行。

I am gettting SQL time out error in my .net service.

As the service is already installed on the production, is there any way I can increase the timeout for the service from App.Config file.

At present, I am getting this exception after one minute, I have to make it to around 10 hours because the stored procedure we are using takes 2-2 hours to execute.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

溺深海 2024-10-05 17:28:47

您可以尝试设置 CommandTimeout 属性在您的 SqlCommand 上。我希望您不要在 ASP.NET 应用程序中执行此操作。

You could try setting the CommandTimeout property on your SqlCommand. I hope you are not doing this in an ASP.NET application.

娇妻 2024-10-05 17:28:47

您可以使用“connect Timeout = 100000000;”在连接字符串中设置超时。或者任何你想要的超时时间

You can set the timeout in your connection string with "connect Timeout = 100000000;" or whatever you want your timeout to be

永言不败 2024-10-05 17:28:47

超时设置由数据库服务器决定。

在 SQL Server 管理器中,打开 SQL Server 属性,然后选择连接选项卡并将超时设置为您需要的大小。

诗。

零表示没有超时。

The time out setting is up to database server.

In SQL Server Manager open the SQL Server Properties and pick the connection tab and set time out as big as You need.

Ps.

zero goes for no timeout.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文