First I unplug my network cable.
Then I try to connect to SQL Server from within C# using an SqlClient.SqlConnection object and a connection string that either does not specify a connection timeout (and thus defaults to 15 seconds): Integrated Security=SSPI;Persist Security Info=False;Data Source=MYSERVER;Database=MYDB"
or a connection string that does specify a timeout, even shorter at 5 seconds: "Integrated Security=SSPI;Persist Security Info=False;Data Source=MYSERVER;Database=MYDB;Connect Timeout=5"
Either way, the call to connection.Open
returns after 42 seconds with my timeout error. If I plug my network cable back in earlier, I can provoke an error sooner. Why is the connection timeout having no effect? Is this documented somewhere? Is there a way around it?