一个连接成功地与服务器建立的,但随后的pre-登录握手期间发生了错误。 TCP提供程序,error:0 [英] A connection was successfully established with the server, but then an error occurred during the pre-login handshake. TCP provider, error: 0

查看:444
本文介绍了一个连接成功地与服务器建立的,但随后的pre-登录握手期间发生了错误。 TCP提供程序,error:0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试连接到托管服务器与Windows XP专业版上的SQL Server 2000数据库时总是得到上述错误。客户端PC(我的工作环境)是Windows 7中

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.

到现在为止我已经使用Visual Studio 2010和.Net框架开发的4.0我的应用程序。
所有正确工作。然后,我已经安装了Visual Studio防爆preSS 2012 Web和ASP.NET 4.5。

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.

现在,当我尝试通过连接的SqlConnection conConnection。开()我得到异常:

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

A connection was successfully established with the server, 
but then an error occurred during the pre-login handshake. 
(provider: TCP Provider, error: 0 - 
An existing connection was forcibly closed by the remote host.)

请注意第二个消息,因为我发现很少的信息上: 一个现有的连接被强行关闭远程主机

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:


  • 各种连接字符串(加密= FALSE;)

  • 的netsh的WinSock显示目录> winsocks.txt(似乎没有在这里发现任何奇怪的应用程序)

  • 客户端和服务器上的netsh winsock重置

  • 从Visual Studio中重新构建应用定位.NET 4.0 / 4.5净额

  • 使用Visual Studio开发服务器或本地IIS Web服务器

  • 重置IIS,重新启动客户端和服务器PC variuos次

  • 检查SQL Server 2000的性能,连接,日志分析器...

我可以尝试下不disinstalling网4.5(和Visual Studio 2012)其他什么?

此相同的应用程序部署在生产服务器(Windows 7中,IIS 7.5,.Net框架4.0)。
在生产实际中的应用与Visual Studio 2010的编译,.NET 4.0,并没有错误(谢天谢地)正确连接!
所以,我已经安装了VS防爆preSS 2012和Asp.net 4.5后,问题出现了我的客户机上。 (我也尝试打开并重新编译与VS2010的解决方案,但我得到同样的除外)。

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).

修改

有关测试目的,我已经部署了应用程序,在VS 2012 / .NET 4.0编译,生产服务器(关于这一点我从来没有安装网4.5当然)。
为此,我创建了一个新的网站,与应用程序池设置为综合管线和定位网框架v4.0.30319。
现在,这个测试网站成功地连接到我的测试SQL Server数据库(SQL 2000),并以我的生产服务器数据库(SQL7)。
线索:

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:

问题仅驻留在我的客户端PC,而罪魁祸首是净4.5?

the problem resides only on my client pc, and the culprit is Net 4.5?

编辑2

通过Visual Studio的连接2010或2012服务器资源管理器,数据来源:Microsoft SQL Server的程序(SqlClient)给出了同样的异常(唯一的区别是,现在是pre-登录握手超时)

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).

而是从Microsoft SQL Server Management Studio中连接2008正常工作(服务器类型:数据库引擎,服务器名称:MYSERVER \\ SQL2000;身份验证:SQL Server的验证;登录名:密码)!

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)

怎么可以从SQL Server Management Studio中连接工作正常?

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

推荐答案

我基本上有同样的问题。成功地运行Win 7的计算机上在Visual Studio 2010,但转移到运行Visual Studio 2012项目是由VS运行时转换一个Windows 8盒ASP.NET项目抛出上述的SQL服务器错误消息。 SQL服务器是远程的,但两个客户端(Win 7的和Win 8)在同一个网络上的本地。一期工程和其他没有。

I am essentially having the same problem. ASP.NET Project that runs successfully on a Win 7 computer in visual studio 2010 but moved to a Windows 8 box running Visual Studio 2012. Project is converted by VS when running it throws the SQL server error message described above. SQL server is remote but both clients (Win 7 and Win 8) are local on the same network. One works and the other doesn't.

在两台机器上在IIS中我发现有正在使用Web应用程序的应用程序池的配置之间的差异比较设置。身份属性默认为ApplicationPoolIdentity如果你改变它,但为网络服务,那么问题得到解决。希望这会帮助别人,因为我已经做了广泛的搜索,并没有发现任何指出了这一点。

Comparing setup on both machines in IIS I found that there is a difference between the configuration of the Application Pool in use by the web application. The Identity property defaults to "ApplicationPoolIdentity" but if you change it to "NetworkService" then the problem is resolved. Hopefully this will help someone else as I have done an extensive search and found nothing that pointed to this.

这篇关于一个连接成功地与服务器建立的,但随后的pre-登录握手期间发生了错误。 TCP提供程序,error:0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆