将我的asp.net mvc Web应用程序部署到IIS7后,无法将其连接到sql server

时间:2014-01-07 23:54:59

标签: asp.net sql-server-2008 iis-7

我有一个asp.net mvc Web应用程序,它用于在从Visual Studio运行时(在调试模式下)很好地连接到sql server。但在使用Windows身份验证将其部署到IIS 7后,我收到以下错误: -

 Login failed for user '<ourDomainName>\<ourServerName>$'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user '<ourDomainName>\<ourServerName>$'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

任何人都可以参与,导致此错误的原因是什么?

Thnaks

1 个答案:

答案 0 :(得分:0)

检查应用程序池标识。看起来您正在使用集成身份验证,如果是这样的话,应用程序池用户需要在Sql Server中拥有适当的权限。