This error occurs when you connect to SQL Server in Windows Server 2003 using a trusted connection (that is, when the value of integrated security is set to true,
In Windows XP, the ASP. NET running account is ASPnet, while in Windows Server 2003, the running account is changed to network service.
Solution:
Step 1: Add 'nt Authority \ Network Service' to the Administrator Group
My computer --> right-click --> Manage --> local users and groups
Select "group" --> double-click "Administrators" --> click "add" --> click "advanced" --> click "find now" --> select a network service user from the list below --> click "OK" --> join twice.
Step 2 Add a netword service user to the Enterprise Manager
Open SQL Server Enterprise Manager --> select database instance --> open "security" node --> select "login" --> right-click the list on the right --> select "New login "--> on the "General" tab, click the button next to "name"... "--> select" Administrators "group --> click the" members "button below --> select" Network Service "--> click" add "--> click" OK ", return to the "New login" dialog box --> ensure that the authentication type is "Windows Authentication" and "Allow access" --> click "OK" --> close "Enterprise Manager"
Step 3
Run Asp.net againProgram, Select windows to verify the database connection string.
In other cases, such errors may also occur. Generally, you can grant the user with the corresponding permissions for Logon errors in SQL Server.