在IIS 6中发布Web应用程序后,数据库连接错误

时间:2012-10-31 06:47:09

标签: asp.net sql-server iis

在IIS 6中发布Web应用程序后,我收到以下错误

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 个答案:

答案 0 :(得分:0)

这可能存在多个问题。但基本问题是Web服务器无法找到DB服务器。

尝试以下步骤找出确切的问题

  1. 是可从您的Web服务器ping通的数据库服务器吗?

  2. 您在连接SQL服务器时是否提供了正确的用户。

  3. 您是否可以使用配置文件中提供的用户名从Web服务器连接到数据库服务器?

  4. 尝试以上所有内容,让我知道您的结果。