I'm building an app in C#. I'm using a connection string like:
DSN=SomeDataSource; Trusted Connection = yes; Uid=SomeId; pwd=somePwd; Connection Timeout=x
But no matter what value I set as x
(Connection Timeout = x
), by putting a breakpoint, I can see that my DbConnection
object's ConnectionTimeout
property always has the default value 15
.
Am I missing something here?
Thanks.
The Connection Timeout
in the ConnectionString only controls the timeout for the connection. If you need to increase the wait time on your Commands, use the CommandTimeout
property of SqlCommand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With