本机开发的应用程式(asp.net(C#)+sqlserver2005),运行没错!
当我把应用程序挂在服务器时,出现数据库连接错误:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
出现这种错误的原因是:sqlserver2005 数据库服务器需设为允许远程访问IP.设置在数据库控制面板中.
注:数据库和应用程式我分为二台机器存放.
详细操作步骤设置请参考:
http://www.cnblogs.com/pkurain/archive/2009/06/26/sqlserver2005_1.html