Login fails for my asp.net user? RRS feed

  • Question

  • User803198322 posted

    I added my machine name aspnet account as a db owner on the database and i still cant login.  I am getting this error:

    Cannot open user default database. Login failed.
    Login failed for user 'F1J2J91\ASPNET'.

    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 user default database. Login failed.
    Login failed for user 'F1J2J91\ASPNET'.

     What can i do so i can login and play in this db as the one on the web doesnt work?  Thanks!

    Friday, September 1, 2006 6:06 PM

All replies

  • User686051332 posted

    I also am getting this error. Anyone know a fix?



    Thursday, September 21, 2006 12:50 PM
  • User803198322 posted
    I have tried all sorts of things and still cant get it to work.  Let me know if you solve it.  I believe that this error can have different meanings and solutions... 
    Friday, September 22, 2006 7:02 PM
  • User1137109038 posted

    I dont get this message if i run the application without debugging (ctrl+F5) but if i try to get to it outside of Visual Studio then i get the error.  I have given my aspnet user read & execute, list folder contents, and read permissions.  I have also attached the db to sql management studio express 05, added my machinename/aspnet user to the security tab, and added it as a user of the database as the db owner but it still wont work.

    Any other thoughts?

    Monday, November 6, 2006 6:59 PM
  • User555306248 posted

    Open your SQL Server Enterprize Manager Go to Logins

    Add the user ASPNET with proper rights..

    Wednesday, April 25, 2007 12:08 AM
  • User-362017084 posted

    Goto SQL Server Management Studio then in Security then Login 

    -Create User MachineName\ASPNET

    And Then Assign Your Database Rights to This User

    Monday, June 9, 2008 12:45 AM
  • User555306248 posted

    You dont need to create user ASP.NET, provided youinstall .net framework

    Just you have to add it under sql server by Open Sql Server Managment Studio - > Security - >Login

    Add here ASP.NET user (By searching it on ypur machine)

    & register it by executing following command

    Open VS command propmt - > aspnet_regiis -i



    Thursday, June 12, 2008 11:35 PM
  • User555306248 posted

    Would a MSDN article do instead of a KB article?  If so, take a look at:


    Scott Guthrie also has a helpful blog entry on the process as well as all sorts of tips working with the Membership database:



    Go to Control Panel -> Administrative Tools -> Computer Management -> Local Users and Groups -> Users -> ASPNET

    Right Click on ASPNET and select Properties

    Go to Member Of tab.

    Click on Add -> Advanced -> Find Now

    Select SQLServer2005MSSQLUser$<machinename>$SQLExpress

    Click on Ok -> Ok - >Apply

    Close all the windows and reboot your machine. It should work now.

    Wednesday, August 6, 2008 11:29 PM
  • User-1061985054 posted

    Create a user 'F1J2J91\ASPNET' in your database by right clicking on folder "security"->New -> login

    Then assign this user to access your database by going to the database, right click and go to properties. Go to file option and map this login to the database so he is allowed to access the database.

    hope it helps.

    Wednesday, June 22, 2011 11:56 AM