sql-server - IIS 7 无法连接到 SQL Server 2008

标签 sql-server asp.net-mvc iis connection-string

对不起,如果这是网络上最常见的问题,但现在轮到我了。我正在尝试在 MS Sql Server 2008 下的 IIS 7 上发布我的 asp.net mvc 应用程序。我在 Windows Server 2008 虚拟机上。我收到以下经典错误:

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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

在 SQLServer 下,允许远程连接被选中。我的连接字符串是:

Data Source=.\MSSQLSERVER;Initial Catalog=mydbname;User Id=sa;Password=mypassword

我也试过没有用户名/密码和“Integrated Security=true”。仅安装了一个 SQLServer 实例。 我试图在本地和远程访问我的网页。虚拟机上没有事件防火墙。

最佳答案

确保在 SQL Server 配置工具中将 TCP/IP 设置为传输。

关于sql-server - IIS 7 无法连接到 SQL Server 2008,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/546702/

相关文章:

SQL Server - 选择没有数据更改的时期

java - 请求 : Microsoft SQL Server JDBC Driver 1. 1

css - TR :nth-child not working in mvc view

authentication - iis7 Challenge-based 和 login redirect-based 认证不能同时使用

sql-server - 为什么 SQL Server 执行计划取决于比较顺序

sql-server - T-SQL : Cannot perform an aggregate function on an expression containing an aggregate or a subquery

c# - 电话号码验证 MVC

asp.net-mvc - 如何在 ASP.NET MVC 中不转义 URL 参数?

asp.net - 如何从命令行自动化 "run asp.net website"?

IIS7.5 : Is there a way to use Require SSL and URL Rewrite Module together for https?