码迷,mamicode.com
首页 > 数据库 > 详细

sql server timeout

时间:2019-02-21 11:08:26      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:msdn   class   lis   val   dde   csharp   try   otn   exec   

SqlConnection.ConnectionTimeout

https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlconnection.connectiontimeout?redirectedfrom=MSDN&view=netframework-4.7.2#System_Data_SqlClient_SqlConnection_ConnectionTimeout

Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.

The time (in seconds) to wait for a connection to open. The default value is 15 seconds.

 

You can set the amount of time a connection waits to time out by using the Connect Timeout or Connection Timeout keywords in the connection string. A value of 0 indicates no limit, and should be avoided in a ConnectionString because an attempt to connect waits indefinitely.

 

SqlCommand.CommandTimeout

https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlcommand.commandtimeout?view=netframework-4.7.2

The time in seconds to wait for the command to execute. The default is 30 seconds.

 

sql server timeout

标签:msdn   class   lis   val   dde   csharp   try   otn   exec   

原文地址:https://www.cnblogs.com/chucklu/p/10410982.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!