无法从asp.net应用程序连接到SQL Server

时间:2013-06-24 09:23:22

标签: asp.net sql-server connection-string

您好我想在IIS服务器上发布我的应用程序。

首先,我在我的sql server中创建一个数据库,并将所有需要的数据放在其上。

然后我更新我的web.config以使用新的远程数据库。不幸的是我得到了一个错误

的ConnectionString:

<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=IntranetDatabase;Data Source=SRVDEV2010\SRVDEV2010" />

Stacktrace:

 [SqlException (0x80131904): 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: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]

如果我可以远程访问数据库,我感到很沮丧。我创建了一个udl文件来验证我的connectionstring,这是结果。

enter image description here

我不知道为什么udl文件可以连接但不能连接我的应用程序。任何帮助表示赞赏

1 个答案:

答案 0 :(得分:0)

哪个用户是配置为运行的应用程序池?您正在使用Windows身份验证,这意味着您的IIS应用程序池应配置为在有权访问数据库的用户下运行。