Wednesday, May 16, 2012

SQL Express Connection Times Out Even Though It is Up

Symptom:

I can access the local SQL Express server instance without a problem using the SMSS, but from my application the SQL connection times out almost immediately.

Cause:

In my situation, it was a connection string issue. In production I use a mirrored connection. So just out of a laziness, I just change two of the hosts in the connection string to be the same.

Like this,

Data Source=localhost;Failover Partner=localhost;Initial....

Apparently the driver does not like this type of conneciton string and give you an immediate timeout error.

Fix

Just remove the Failover Partner part and try. It always does the trick to me.


Post a Comment