PDA

View Full Version : How to setup ASPNET user account?


chelvis
06-23-2006, 01:26 AM
I created an application (application name: ContactManagement) and compiled and every thing was fine. When I loaded in IE, I got the following error:

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

When I look at the URL of this error page: http://localhost/ContactManagement/SwitchBoard.aspx

So one of my friend told me I have to setup the user ASPNET from the control panel. But I couldnt find it.
Can some one know how to do this and help me?

Brandoe85
06-23-2006, 01:51 AM
You need to add the aspnet account in sql server:
http://weblogs.asp.net/coltk/archive/2003/07/10/9920.aspx

otaku149
06-23-2006, 04:36 AM
But I couldnt find it. Can some one know how to do this and help me?
Did you try what I provided to you the other day:
http://www.codingforums.com/showthread.php?t=89256

Here is once again:

Open SQL Server Enterprise Manager
Expand CHELVI\NETSDK
Expand Databases
Expand the database (the one you try to connect)
Right-click on Users + New database user...
Use the drop-down list to select the Login name: CHELVI\ASPNET
Tick public and db_owner
Click "OK"

If on step #6 you don't see CHELVI\ASPNET in the drop-down menu, use the following directives instead:

In Enterprise Manager
Expand CHELVI\NETSDK again
Expand Security
Right click on "Logins" and click on "new login..."
You will see a top menu with 3 tabs, from the "General" tab, Windows Authentication will be already tick
Domain: select CHELVI from the drop down menu
Name: you will see CHELVI in the textbox, now click the button at the right of that textbox
From the menu select "ASPNET(ASP.NET Machine Account...)"
Click on "Add" and "OK"
Now select "Database Access" from the top tabs menu
Tick your database
Tick "db_owner" and "public"
Click "OK"

chelvis
06-23-2006, 04:23 PM
Thanks so much for your help otaku149. I got it and now I can run my application. I appreciate it. Yeh, the other day I tried and I couldnt find what you mentioned. Now its working because the second part you provided is the one I tried and worked.

otaku149
06-23-2006, 04:54 PM
Thanks so much for your help otaku149. I got it and now I can run my application. I appreciate it.

You're welcome chelvis :)

Yeh, the other day I tried and I couldnt find what you mentioned. Now its working because the second part you provided is the one I tried and worked.

That's what I thought reading this current thread. Just let me know next time when I provide to you some help and you face some problems, that way I will be able to help you.

Nik
07-13-2006, 08:20 AM
Hi,

I have same problem with SQL Server 2005.I cant create ASPNET user in 2005.

Please help,

Thanks,
Nik

chelvis
07-13-2006, 03:28 PM
You have to follow the steps otaku149 said earlier. If you follow one of them, the problem should get solved.