“SQL Server does not allow remote connections”错误的解决

安装DNN 4.8的时候出现这个错误

Connection Error(s):

Index #: 0
Source: .Net SqlClient Data Provider
Class: 20
Number: 53
Message: 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)

因为
对于SQL Server 2005 Express Edition 和 SQL Server 2005 Developer Edition 默认的设置是不允许 remote connections 的,参考MSDN的文档可以更改设置http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277

我的机器上安装了SQL 2000 的Personal版本和SQL 2005 Express(随VS自动安装的),我使用的是SQL 2000的Personal版本,应该不存在这个问题。在研究一番之后找到了答案。

在没有安装SQL 2005 Express之前,我的机器上只有一个SQL Server,我一般在连接字符串里使用local来指明使用本地的SQL 2000 Personal 版本。安装Express版后,机器上会存在两个SQL 的实例。如图:


一个是LAND001(我的计算机名),一个是LAND001\SQLEXPRESS。这个时候,如果还是用local来指代SQL Server Personal版本,DNN安装是不会找Personal版,而是找到 Express版。

解决办法,连接字符串中使用SQL的实例名准确指定要使用的SQL Server,比如LAND001。
原文地址:https://www.cnblogs.com/DotNetNuke/p/1215913.html