By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,225 Members | 2,170 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,225 IT Pros & Developers. It's quick & easy.

Login Failed

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.