Error:
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.
Note: XXX = the name of the user.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";
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.