2011-12-06 38 views
1

我试图从位于服务器(具有IIS7)的应用程序访问位于我的计算机上的SQL数据库。
我设置的ConnectionString在我的电脑的IP的WebConfig,我总是得到这样的错误:无法建立与SQL Server的连接

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

我想,因为它是在错误中提到启用远程连接。这些是我为了尝试过的东西,使其工作:

  1. 确认在“允许远程连接”到这台服务器在我的服务器的属性窗口中检查
  2. 启用TCP/IP的SQL服务器配置管理器
  3. 右键单击TCP/IP并在“属性”中将端口设置为1433并删除动态端口中的“0”
  4. 在Windows防火墙中创建新规则以允许从端口进行连接1433
  5. 将MSSQL/Binn文件夹中的sqlservr.exe添加到“允许程序通过Windows防火墙”
  6. 重新启动该服务

它没有帮助。我还可以做些什么?

编辑:
连接字符串:

<connectionStrings> 
    <add name="someName" connectionString="Database=someDB;Server=<my computer's IP>;User=userName;Password=123" providerName="System.Data.SqlClient"/> 
</connectionStrings> 
+0

您可以发布您的连接字符串。 – BizApps

+0

更改了TCP/IP设置后,您是否重新启动了SQL Server进程? – Vamsi

+0

您是否尝试过ping,telnet,SSMS? –

回答