469,609 Members | 1,666 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Login Failed

RN1
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.
Jun 27 '08 #1
4 1801
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" <rn**@rediffmail.comwrote in message
news:19**********************************@w34g2000 prm.googlegroups.com...
>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.

Jun 27 '08 #2
Sounds like an issue with your connection string. I would study that.

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

"RN1" <rn**@rediffmail.comwrote in message
news:19**********************************@w34g2000 prm.googlegroups.com...
>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.
Jun 27 '08 #3
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" <rn**@rediffmail.comwrote in message news:19**********************************@w34g2000 prm.googlegroups.com...
>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.

Jun 27 '08 #4
RN1
On Jun 23, 10:31*pm, "Juan T. Llibre" <nomailrepl...@nowhere.com>
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" <r...@rediffmail.comwrote in messagenews:19**********************************@w 34g2000prm.googlegroups.com...
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.
Jun 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Matthew Louden | last post: by
4 posts views Thread by Chuck Bowling | last post: by
12 posts views Thread by Michael | last post: by
11 posts views Thread by Anil Gupte | last post: by
4 posts views Thread by Brett | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.