Results 1 to 3 of 3

Thread: Login error

  1. #1
    Join Date
    Aug 2008

    Unanswered: Login error

    Has anyone ever had this type of error? And how do I go about fixing this issue? I will give as much info as possible: Running Win7, ASP.NEt, Site was designed in Visual Studio 2008 and Dreamweaver CS4, Using IIS 7, Microsoft SQL Server 2008 Express. I hope this is enough info.

    Server Error in '/NuthinButOldSchool' Application.

    Cannot open database "aspnetdb" requested by the login. The login failed.
    Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.
    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 "aspnetdb" requested by the login. The login failed.
    Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.

    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.

    Stack Trace:

    [SqlException (0x80131904): Cannot open database "aspnetdb" requested by the login. The login failed.
    Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.]
    System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +5038006
    System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning() +234
    System.Data.SqlClient.TdsParser****n(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
    System.Data.SqlClient.SqlInternalConnectionTds.Com pleteLogin(Boolean enlistOK) +35
    System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183
    System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
    System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +218
    System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
    System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
    System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
    System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +524
    System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66
    System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject, Boolean& isNewConnection) +933
    System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +154
    System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
    System.Data.SqlClient.SqlConnection.Open() +125
    System.Web.DataAccess.SqlConnectionHolder.Open(Htt pContext context, Boolean revertImpersonate) +95
    System.Web.DataAccess.SqlConnectionHelper.GetConne ction(String connectionString, Boolean revertImpersonation) +206
    System.Web.Security.SqlMembershipProvider.GetPassw ordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +827
    System.Web.Security.SqlMembershipProvider.CheckPas sword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
    System.Web.Security.SqlMembershipProvider.Validate User(String username, String password) +106
    System.Web.UI.WebControls.Login.AuthenticateUsingM embershipProvider(AuthenticateEventArgs e) +60
    System.Web.UI.WebControls.Login.OnAuthenticate(Aut henticateEventArgs e) +123
    System.Web.UI.WebControls.Login.AttemptLogin() +127
    System.Web.UI.WebControls.Login.OnBubbleEvent(Obje ct source, EventArgs e) +101
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
    System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e) +118
    System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +167
    System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

    Version Information: Microsoft .NET Framework Version:4.0.21006; ASP.NET Version:4.0.21006.1

  2. #2
    Join Date
    Jan 2003
    Provided Answers: 17
    Does the IIS APPPOOL\ASP.NET v4.0 user have rights to access the aspnetdb database?

  3. #3
    Join Date
    Aug 2008

    Talking I figured it out

    See I have it working fine on my actual box that is running Win2k8. But I wanted to also run my websites in Vmware Workstation within Win7. The problem was for my one site(Welcome to Ver-Fi Classics), was that I needed to change that IISAPPPool in IIS 7to Localsystem that has permission. Then for my other site(, I had to change the connection string for both my web.config's, I had to change one string to my machine's name and for the other web config, that has a upload database, I had to change the connection string altogether. But now everything is running fine in Virtual environment. I knew it had something to do with permission, I just didn't exactly know where. Everything is cool now...

    So thank you for your reply

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts