這是我的連接字符串:如何配置SQL Server與ASP.NET MVC一起使用Windows身份驗證?
<add name="MyDb" providerName="System.Data.SqlClient" connectionString="Server=localhost;Data Source=.\MSSQLSERVER;Initial Catalog=MyDb;Integrated security=SSPI;" />
它的工作我的本地機器上就好了,但我的服務器上,部署我的應用程序後,它不想工作,它給了我這個錯誤:
[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: 25 - Connection string is not valid)]
當我更改連接字符串以使用帳戶憑證-sa,它連接的很好,所以我確切地知道這是錯誤的sql服務器配置的問題。
所以我的問題是:我已經新安裝的SQL Server實例,如何配置它,所以它允許Windows身份驗證我的asp.net MVC應用程序?
編輯:好吧,畢竟,我再次查看了我的連接字符串,並刪除了Data Source =。\ MSSQLSERVER。它幫助了,現在一切正常,謝謝你們的幫助。
這是什麼,謝謝。無論如何,我像你說的那樣做了,並且有叫'IIS APPPOOL \ DefaultAppPool'的用戶。我也改變了我的應用程序從defaultapppool運行(btw defaultapppool被列爲本地服務)。但我仍然得到同樣的錯誤。我現在能做什麼? :/ – ojek 2013-02-17 17:56:49