connection timeout property in connection string ignored

c#, connection-string, timeout

Solution

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.

Problem

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.

Original source