I am developing an ASP.NET application in VS 2010 with a SQL Server 2000 backend (I know, I know . . .)
I have been working just fine with this setup for the greater part of the last 3 months. However, yesterday I did apply VS 2010 SP1 and now connecting to this database causes the following error:
Connection Timeout Expired. The timeout period elapsed while
attempting to consume the pre-login handshake acknowledgement. This
could be because the pre-login handshake failed or the server was
unable to respond back in time. The duration spent while attempting
to connect to this server was – [Pre-Login] initialization=72;
handshake=44924
Keep in mind that I have made NO changes to either the connection string or the SQL Server 2000 server/database. So there must be a reason why it’s happening since the new additions.
My connection items are fairly vanilla with
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = sqlStatement;
SqlDataReader dr = cmd.ExecuteReader();
resultData.Load(dr);
dr.Close();
conn.Close();
And my connection string looks like
Data Source=192.168.1.200;Persist Security Info=false;Initial Catalog=MyDB;User Id=MyUser;Password=MyPW;Timeout=45;
You can see that I made changes to the timeout but this didn’t work. But, again, I shouldn’t have to make any changes. I just applied the VS 2010 SP 1 yesterday, that has been the only change. HELP!
I fixed this by opening up port 1433 (SQL) on the server firewall.