Sunday, December 5, 2010

Login failed for user 'XXX\ASPNET'


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.

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.


Related Posts

Dual Axis not Working in Tableau

Problem : When creating chart with Dual Axis, Synchronize Axis is disabled and cannot be clicked. Cause : Tableau identified this as ...

About Me

My photo
Is an ordinary unNoticed 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. I like English and Chinese language, and know a little about them. Hence, for me, most things can best be expressed in Chinese, some in English, and the rest in others ^^

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



Follow by Email