问题
I have a brand new server with Windows 2008 Server 64 bit + SQL Server 2005 Standard Edition SP3.
When I try to open a connection to this server from a client in the same domain (Windows XP, .Net 3.5), it takes around 20 seconds to open the connection.
After opening the connection, everything is fast as usual.
When using a MDAC 2.8 connection, or ADO.NET OleDb, there is no problem at all.
How can I find the reason for the slow connection?
回答1:
The problem was the firewall running on the server. I added an exception for port 1433 and the problem was gone.
Possible explanation: maybe when using OLEDB the connection tries Name Pipes first, bypassing the firewall rules.
来源:https://stackoverflow.com/questions/1178931/very-slow-connection-to-sql-server-2005-only-if-using-ado-net-with-sqlclient