2013-06-04

I always get the above error when trying to connect to a SQL server 2000 database hosted on a "server" with Windows XP pro. The client pc (my working environment) is Windows 7.

Up to now I have developed my application using Visual Studio 2010 and Net framework 4.0.
All was working correctly. Then I have installed Visual Studio Express 2012 for Web and ASP.NET 4.5.

Now, when i try to connect via SqlConnection conConnection .Open() i get the Exception:

Please note the second message, because I have found very little info on that: An existing connection was forcibly closed by the remote host.

I have yet unsuccessfully tried a myriad solutions, including:

Various connection strings (Encrypt=false; )

netsh WinSock Show Catalog > winsocks.txt (don't seem to spot any strange application here)

netsh Winsock reset on both client and server

Rebuilding the app from Visual Studio targeting Net 4.0 / Net 4.5

Use Visual Studio Development Server or Local IIS Web Server

IIS reset, restarting Client and Server pc variuos times

Checked the SQL Server 2000 properties, connections, logs, profiler...

What other could I try next without disinstalling Net 4.5 (and Visual Studio 2012)?

Important additional info

This same application is deployed in a production server (Windows 7, IIS 7.5, Net framework 4.0).
The application actually in production was compiled with Visual Studio 2010, net 4.0, and is connecting correctly with no errors (thankfully)!
So, the problem has arisen on my client machine after I have installed VS Express 2012 and Asp.net 4.5. (I have also tried to open and recompile the solution with VS2010, but I get the same exception).

EDIT

For testing purpose, I have deployed my application, compiled with VS 2012 / Net 4.0, to the "production" server (on which I have never installed Net 4.5 of course).
For this I have created a new Web Site, with Application pool set to Integrated pipeline and targeting Net Framework v4.0.30319.
Now, this test web site connect successfully to my test SQL Server database (SQL 2000) and also to my production server database (SQL7).
Clue:

EDIT 2

Connecting via Visual Studio 2010 or 2012 Server Explorer, Data Source: Microsoft SQL Server (SqlClient) gives the same Exception (only difference is that now is pre-login handshake timeout).



Instead Connecting from Microsoft SQL Server Management Studio 2008 works fine! (Server type: Database engine; Server name: myserver\SQL2000; Authentication: SQL Server Auth; Login: Password)



How can be that the connection from SQL Server Management Studio works fine?

Show more