2012-08-16 139 views
0

我創建了一個示例網站。我正在使用Linq作爲模型。我試圖東道國,在IIS 5.1.But我的網站時,我試圖(通過IIS 5.1 acceesing頁)登錄我得到follwing錯誤:在IIS 5.1中託管網站

Cannot open database "WCF" requested by the login. The login failed.Login failed for user . 

WCF是數據庫的名稱。 我的認證部分的web.config是

<authentication mode="Forms"> 
     <forms loginUrl="Default2.aspx" timeout="2880" /> 
    </authentication> 

安全性和身份驗證設置這是我在IIS中 enter image description here

我的connectionString是

<connectionStrings> 
    <add name="WCFConnectionString" connectionString="Data Source=localhost;Initial Catalog=WCF;Integrated Security=True" providerName="System.Data.SqlClient"/> 
</connectionStrings> 

任何想法爲什麼會發生? 請幫忙。

+0

失敗的登錄名是您用來連接數據庫的登錄名。你的connectionString是什麼樣的? – 2012-08-16 09:45:19

+1

IUSR_ExXP是否對您的數據庫擁有登錄權限?在使用集成安全性時,它將使用IIS進程運行的任何帳戶 - 在這種情況下,似乎是IUSR_ExXP。 – 2012-08-16 10:14:04

+0

謝謝,@ J.Steen,我能解決我的問題。 – 2012-08-16 11:01:52

回答

1

IUSR_ExXP是否對您的數據庫擁有登錄權限?當您使用集成安全性時,它將使用IIS進程運行的任何帳戶 - 在這種情況下似乎是IUSR_ExXP