Sqlclient - connection timeout or command timeout

I get the following error when starting a request.

*

System.Data.SqlClient.SqlException: Timed out.
The wait period expires before the operation is completed or the server is not responding. in System.Data.SqlClient.SqlConnection.OnError (SqlException exception exception, logical connection breaks)

*

Is this a connection timeout or a command timeout?

TIA

+3
source share
3 answers

It looks like a team timeout. If you have a connection timeout, you will see from the stack trace that he selected from the SqlConnection.Open call. Any other timeout will be a command timeout.

+1

, . - - sqlexception, .

, ? . , . , .

+1

How long does the request take when starting from SSMS?

If you are fast, then the problem can be a dead end.

Do you use any transactions? Do you share the database with other applications / users?

More information would be very helpful.

0
source

Source: https://habr.com/ru/post/1744190/


All Articles