Login Failed for User ASPNET

Last post 03-21-2005 4:50 PM by bitYavrusu. 5 replies.

Sort Posts:

  • Login Failed for User ASPNET

    02-22-2005, 3:25 PM
    • Participant
      1,337 point Participant
    • Dave Ruhl
    • Member since 12-13-2004, 4:14 PM
    • Posts 273
    My website runs fine in WebMatrix, using the MSDE database. When I try to run it 'live' on the IIS server I get the error below. The following describes my environment:

    - IIS 6.0 and SQL Server 2002 both running on the same server.
    - This server is also running as a terminal server.
    - I am using "trusted_connection=true" in my connection string.
    - mydomain\ASPNET is a domain user with full rights to that server and database.
    - I have explicitly given ASPNET rights to the website in IIS, and to the database in SQL Server.
    - I can login to the server as ASPNET and access the website folder, and all tables in the database.
    - As ASPNET, I can run the website in WebMatrix, but not the 'live' version.

    Question: should ASPNET just be a local user to that server instead of a domain user ? Since the error message (see below) says "'myservername\ASPNET" and not "mydomain\ASPNET" I'm thinking that may be the case. However, I'm pretty sure I already tried this before we made it a domain user.

    Any help would be greatly appreciated, as I've been struggling with this for a couple of weeks now. Thanks!!!

    --------------------------------------------------------------------------------
    Server Error in '/' Application.

    Login failed for user 'myservername\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: Login failed for user 'myservername\ASPNET'.

    Source Error:


    Line 40: dataAdapter.SelectCommand = dbCommand
    Line 41: Dim dataSet As System.Data.DataSet = New System.Data.DataSet
    Line 42: dataAdapter.Fill(dataSet) <== Highlighted as the line that caused the error
    Line 43:
    Line 44: Return dataSet

  • Re: Login Failed for User ASPNET

    02-23-2005, 7:08 PM
    • Participant
      1,337 point Participant
    • Dave Ruhl
    • Member since 12-13-2004, 4:14 PM
    • Posts 273
    Am I the only one to ever encounter this problem ??? Or is no one up to the challenge ;)
  • Re: Login Failed for User ASPNET

    02-24-2005, 8:26 AM
    • Participant
      1,090 point Participant
    • lofquest
    • Member since 06-20-2003, 11:04 AM
    • Posts 218
    As you said you've already set all permissions from IIS and SqlServer so try going to your folder app right click mouse and add ASPNET user
  • Re: Login Failed for User ASPNET

    02-24-2005, 12:20 PM
    • Participant
      1,337 point Participant
    • Dave Ruhl
    • Member since 12-13-2004, 4:14 PM
    • Posts 273
    That was it !!!

    The parent folder was set as shared with Everyone, but the Website folder was not shared. After giving user ASPNET Read permission, everything works ! However, I'm a bit confused on why I was able to get to the Login page, which is in that folder, and only got the error after logging in and trying to open the next page. That's why I didn't even think about a rights issue with the folder.

    Thanks very much for your tip !!!
  • Re: Login Failed for User ASPNET

    02-24-2005, 4:06 PM
    • Participant
      1,090 point Participant
    • lofquest
    • Member since 06-20-2003, 11:04 AM
    • Posts 218
    The likely cause is that you are working with a Web application and are trying to access a SQL Server.(and at first page you did not). Take a look at this article


  • Re: Login Failed for User ASPNET

    03-21-2005, 4:50 PM
    • Member
      5 point Member
    • bitYavrusu
    • Member since 02-04-2005, 1:47 AM
    • Posts 1
    could you please tell me where i can set the permissions under windows xp?i have my iis telling me that ASPNET user can't login to the sql server running on localhost and,of course,ASPNET user is defined within sql server with full permissions on all databases (probably a lot more permissions than it needs).
Page 1 of 1 (6 items)