SqlCommand.CommandTimeout和SqlConnection.ConnectionTimeout之间的区别是什么?区别、CommandTimeout、SqlCommand、Conne

由网友(埋没我的痴狂)分享简介:有 SqlCommand.CommandTimeout 和.NET SqlConnection.ConnectionTimeout 之间有什么区别?Is there any difference between SqlCommand.CommandTimeout and SqlConnection.Connecti...

SqlCommand.CommandTimeout 和.NET SqlConnection.ConnectionTimeout 之间有什么区别?

Is there any difference between SqlCommand.CommandTimeout and SqlConnection.ConnectionTimeout in .NET?

推荐答案

是的。 CommandTimeout是多长一个命令可以完成。 ConnectionTimeout是多久可以采取建立到服务器的连接开始。

Yes. CommandTimeout is how long a single command can take to complete. ConnectionTimeout is how long it can take to establish a connection to the server to start with.

例如,您可能执行比较长时间运行的查询 - 这是完全没问题的他们需要10分钟才能完成,但如果花了10分钟,以开始与连接,你会知道什么是厉害错了。

For instance, you may be executing relatively long-running queries - it's perfectly okay for them to take 10 minutes to complete, but if it took 10 minutes to make the connection to start with, you'd know that something was badly wrong.

阅读全文

相关推荐

最新文章