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.
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.
So what's the correct way to do this? Thanks.