2013-06-24 136 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

相關問題