我是 asp.net 和 IIS 的新手,我正在开发一个使用 asp.net 进行学习的网站。首先,我使用 vwd 创建了一个新的空白网站,物理目录是 C:\inetpub\web1,但后来我将 web1 移动到 C:\inetpub\wwwroot 并打开 IIS 并将目录转到应用程序并尝试使用浏览器出现错误信息,
Server Error in '/web1' Application.
Cannot open database "testdb" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
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: Cannot open database "testdb" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
Source Error:
Line 34:
Line 35: SqlConnection dbCon = new SqlConnection(ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString);
Line 36: dbCon.Open();
Line 37:
Source File: c:\inetpub\wwwroot\web1\App_Code\tree.cs Line: 36
Stack Trace:
[SqlException (0x80131904): Cannot open database "test" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1270
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.SqlClient.SqlConnection.Open() +125
Node.buildTree(String contentType, String mode) in c:\inetpub\wwwroot\web1\App_Code\tree.cs:36
header.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\web1\header.aspx.cs:14
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
有谁知道是什么问题?
谢谢