C#SQL命令超时 [英] C# SQL command timeout

查看:307
本文介绍了C#SQL命令超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hej,



我有一个sql命令超时3分钟的应用程序。如果查询在1分钟内完成处理会有什么影响。



任何帮助都将不胜感激。



提前致谢




我的尝试:



Hej,



我的应用程序有一个sql命令超时3分钟。如果查询在1分钟内完成处理会有什么影响。



任何帮助都将不胜感激。



提前致谢

Hej,

I have an application that has a sql command timeout 3 minute. what would be the impact if query finishes processing in 1 minute.

Any help would be appreciated.

Thanks in advance


What I have tried:

Hej,

I have an application that has a sql command timeout 3 minute. what would be the impact if query finishes processing in 1 minute.

Any help would be appreciated.

Thanks in advance

推荐答案

请参阅 SqlCommand.CommandTimeout属性(System.Data.SqlClient) [ ^ ]



Please refer SqlCommand.CommandTimeout Property (System.Data.SqlClient)[^]

Quote:

我的应用程序有一个sql命令超时3分钟

I have an application that has a sql command timeout 3 minute



它意味着 SQl命令可以等待最多3分钟来完成sql查询的执行,除此之外它将抛出异常。




It Means the SQl Command can wait for maximum 3 mins to complete the execution of sql query, beyond that it will throw an exception.

引用:

如果查询完成,将会产生影响在1分钟内处理。

hat would be the impact if query finishes processing in 1 minute.



无影响,它将执行正常。


No Impact, It will execute Fine.


命令超时是 最大值 完成命令的时间:如果它在那段时间内没有完成,它就会中止并引发错误。

如果它完成的时间少于那个时间,返回数据并忽略超时值。默认值为30秒。

SqlCommand.CommandTimeout属性(System.Data.SqlClient) [ ^ ]


这篇关于C#SQL命令超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆