title: How to limit the wait time for SqlConnection.Open()?
body: <p>I want to test if the connection string is correct, so I created a new SqlConnection, called its Open() method. But I have to wait a long time before it returns when the server/data_source part of connection string is wrong.</p>
  
  <p>I tried adding connection timeout to the connection string, it didn't work;
  I tried open the connection in another thread, then I call Thread.Abort() after several seconds.
  None of them worked.</p>
  
  <p>So what's the correct way to do this?
  Thanks.</p>