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.

 

相关文章:

  • 2022-01-29
  • 2021-07-28
  • 2021-12-09
  • 2021-06-06
  • 2021-06-23
猜你喜欢
  • 2021-11-27
  • 2022-01-23
  • 2021-10-14
  • 2021-04-28
  • 2021-11-01
相关资源
相似解决方案