2013-06-24 88 views
0

嗨,我想在IIS服务器中发布我的应用程序。无法从asp.net应用程序连接到SQL Server

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

然后我更新我的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" /> 

堆栈跟踪:

[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.)] 

我cheked如果我能remotly访问数据库。我创建了一个udl文件来验证我的connectionstring,结果如下。

enter image description here

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

回答

0

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

+0

我的应用程序在使用NetworkService for Identity的池下,我认为问题不存在,因为我在同一个池下有另一个应用程序,并且它工作得很好。 – 113408

+0

那么UDL运行在你的windows用户下,试着设置应用程序池为你的本地windows用户。 –

+0

你能给我更多的细节吗? – 113408

相关问题