Multiple choice technology programming languages

What is the default timeout for SqlCommand Object

  1. 10 sec

  2. 5 sec

  3. 30 sec

  4. 0 sec

Reveal answer Fill a bubble to check yourself
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.