Sunday, December 5, 2010

Login failed for user 'XXX\ASPNET'

Error:

Server Error in '/ExamWebsite' Application.

Login failed for user 'XXX\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 'XXX\ASPNET'. Source Error:
Line 60:                 DataTable dt = new DataTable();
Line 61: 
Line 62:                 conn.Open();
Line 63:                 cmd.Connection = conn;
Line 64:                 cmd.CommandText = "spr_GetVisit";
Note: XXX = the name of the user.

This error usually occurs when using integrated security for the database connection.

Solution:
For SQL Server 2000's users:
1. Go to SQL Server Enterprise Manager.
2. Expand the tab Microsoft SQL Servers -> SQL Server Group -> Server used -> Security.
3. Right Click on Logins, then select New Login.
4. On the Name textbox, type xxx\ASPNET, then click "..." on the right. (where xxx is the name of the user). Choose ASPNET on the new dialog window displayed, then click Add -> OK.
5. On Server Roles tab, check System Administrators.
6. On Database Access tab, check the databases to be used, and check the roles as public and db_owner.
7. Click OK.
Share:

1 comment:

You may be intersted in

Related Posts

Updating Table Containing Xml Column via LinkedServer

If you are trying to update a table containing XML column via Linked Server in SQL Server, and you are not able to, you are not alone. There...

About Me

My photo
Is an ordinary man, with a little knowledge to share and high dreams to achieve. I'd be glad if I can help others, 'coz the only thing for the triumph of evil is for a good man to do nothing.

About Blog

You can find a lot of debugging and deploying problems while developing applications in .NET and Visual Basic here. There are also some querying tips in SQL and typical source codes which might be useful shared here.

Popular Posts

Blogroll

Followers

Leave a Message