What is the default timeout for SqlCommand Object
-
10 sec
-
5 sec
-
30 sec
-
0 sec
C
Correct answer
Explanation
The SqlCommand object in ADO.NET has a default CommandTimeout of 30 seconds. This property controls how long the command waits for a response from the server before throwing a timeout exception. It can be modified via the CommandTimeout property if queries need more or less time. The 30-second default balances between allowing reasonable execution time for complex queries and preventing indefinite hangs.