Login Failed

Discussion in 'ASP .Net' started by RN1, Jun 23, 2008.

  1. RN1

    RN1 Guest

    I am working on WinXP Pro SP3, .NET 2.0 & SQL Server 2005 (Windows
    Authentication). When I run a ASPX page that connects to SQL Server,
    the following error gets generated:

    Login failed for user 'RON\ASPNET'

    where RON is my machine name. I came across a few posts which
    suggested adding RON\ASPNET as a User in SQL Server Management Studio
    Express (under Security--->Logins node). I did so but that didn't
    resolve the problem.

    Can someone please advice me how do I overcome this problem?

    BTW, is Windows Authentication more secure or SQL Server
    Authentication? Under what circumstances should one be preferred over
    the other?

    Thanks.
    RN1, Jun 23, 2008
    #1
    1. Advertising

  2. Are you sure you specified Windows authentication in your connection string?

    Windows Authentication is more secure for an obvious reason that you don't
    need to store and to pass the password.

    You may also consider impersonating the ASPNET account as some other
    account. It may help you in troubleshooting.

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "RN1" <> wrote in message
    news:...
    >I am working on WinXP Pro SP3, .NET 2.0 & SQL Server 2005 (Windows
    > Authentication). When I run a ASPX page that connects to SQL Server,
    > the following error gets generated:
    >
    > Login failed for user 'RON\ASPNET'
    >
    > where RON is my machine name. I came across a few posts which
    > suggested adding RON\ASPNET as a User in SQL Server Management Studio
    > Express (under Security--->Logins node). I did so but that didn't
    > resolve the problem.
    >
    > Can someone please advice me how do I overcome this problem?
    >
    > BTW, is Windows Authentication more secure or SQL Server
    > Authentication? Under what circumstances should one be preferred over
    > the other?
    >
    > Thanks.
    Eliyahu Goldin, Jun 23, 2008
    #2
    1. Advertising

  3. Sounds like an issue with your connection string. I would study that.

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com

    "RN1" <> wrote in message
    news:...
    >I am working on WinXP Pro SP3, .NET 2.0 & SQL Server 2005 (Windows
    > Authentication). When I run a ASPX page that connects to SQL Server,
    > the following error gets generated:
    >
    > Login failed for user 'RON\ASPNET'
    >
    > where RON is my machine name. I came across a few posts which
    > suggested adding RON\ASPNET as a User in SQL Server Management Studio
    > Express (under Security--->Logins node). I did so but that didn't
    > resolve the problem.
    >
    > Can someone please advice me how do I overcome this problem?
    >
    > BTW, is Windows Authentication more secure or SQL Server
    > Authentication? Under what circumstances should one be preferred over
    > the other?
    >
    > Thanks.
    Jonathan Wood, Jun 23, 2008
    #3
  4. re:
    !> the following error gets generated:
    !> Login failed for user 'RON\ASPNET'
    !> where RON is my machine name. I came across a few posts which

    You need to add RON\ASPNET as a login to SQL Server 2005
    and specify that login as a user of your database.

    re:
    !> I came across a few posts which suggested adding RON\ASPNET as a User
    !> in SQL Server Management Studio Express (under Security--->Logins node).
    !> I did so but that didn't resolve the problem.

    Adding the login is not enough.
    You must also add the login name to the users for your database.

    re:
    !> BTW, is Windows Authentication more secure or SQL Server Authentication?
    !> Under what circumstances should one be preferred over the other?

    I prefer to use SQL Server authentication.
    That way, I can use an ad-hoc user to authenticate.

    Ymmv...



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "RN1" <> wrote in message news:...
    >I am working on WinXP Pro SP3, .NET 2.0 & SQL Server 2005 (Windows
    > Authentication). When I run a ASPX page that connects to SQL Server,
    > the following error gets generated:
    >
    > Login failed for user 'RON\ASPNET'
    >
    > where RON is my machine name. I came across a few posts which
    > suggested adding RON\ASPNET as a User in SQL Server Management Studio
    > Express (under Security--->Logins node). I did so but that didn't
    > resolve the problem.
    >
    > Can someone please advice me how do I overcome this problem?
    >
    > BTW, is Windows Authentication more secure or SQL Server
    > Authentication? Under what circumstances should one be preferred over
    > the other?
    >
    > Thanks.
    Juan T. Llibre, Jun 23, 2008
    #4
  5. RN1

    RN1 Guest

    On Jun 23, 10:31 pm, "Juan T. Llibre" <>
    wrote:
    > re:
    > !> the following error gets generated:
    > !> Login failed for user 'RON\ASPNET'
    > !> where RON is my machine name. I came across a few posts which
    >
    > You need to add RON\ASPNET as a login to SQL Server 2005
    > and specify that login as a user of your database.
    >
    > re:
    > !> I came across a few posts which suggested adding RON\ASPNET as a User
    > !> in SQL Server Management Studio Express (under Security--->Logins node).
    > !> I did so but that didn't resolve the problem.
    >
    > Adding the login is not enough.
    > You must also add the login name to the users for your database.
    >
    > re:
    > !> BTW, is Windows Authentication more secure or SQL Server Authentication?
    > !> Under what circumstances should one be preferred over the other?
    >
    > I prefer to use SQL Server authentication.
    > That way, I can use an ad-hoc user to authenticate.
    >
    > Ymmv...
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq :http://asp.net.do/faq/
    > foros de asp.net, en español :http://asp.net.do/foros/
    > ======================================
    >
    >
    >
    > "RN1" <> wrote in messagenews:...
    > >I am working on WinXP Pro SP3, .NET 2.0 & SQL Server 2005 (Windows
    > > Authentication). When I run a ASPX page that connects to SQL Server,
    > > the following error gets generated:

    >
    > > Login failed for user 'RON\ASPNET'

    >
    > > where RON is my machine name. I came across a few posts which
    > > suggested adding RON\ASPNET as a User in SQL Server Management Studio
    > > Express (under Security--->Logins node). I did so but that didn't
    > > resolve the problem.

    >
    > > Can someone please advice me how do I overcome this problem?

    >
    > > BTW, is Windows Authentication more secure or SQL Server
    > > Authentication? Under what circumstances should one be preferred over
    > > the other?

    >
    > > Thanks.- Hide quoted text -

    >
    > - Show quoted text -


    Thanks friends for your suggestions.

    >> Adding the login is not enough.
    >> You must also add the login name to the users for your database.


    Yes...yes...that's where I was erring. I didn't add the login name to
    the users for the database. After adding that login, I can now connect
    & retrieve data from the database.

    Thanks once again,

    Regards.
    RN1, Jun 24, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Z2FyaWJhbGRp?=
    Replies:
    2
    Views:
    4,923
    =?Utf-8?B?Z2FyaWJhbGRp?=
    Feb 25, 2005
  2. sck10
    Replies:
    6
    Views:
    913
    sck10
    Sep 1, 2006
  3. Homer
    Replies:
    3
    Views:
    7,978
    Alexey Smirnov
    Sep 25, 2007
  4. Tony Johansson
    Replies:
    3
    Views:
    16,202
    Patrice
    Jan 2, 2010
  5. Max
    Replies:
    0
    Views:
    394
Loading...

Share This Page