Practice
If, when connecting from ASP.NET to MS SQL Server from IIS 7 on a server running Microsoft Windows Server 2008 (R2), the following error occurs:
Then do the following:
1) Open the IIS snap-in (Start -> Administrative Tools -> Internet Information Services (IIS) Manager)
2) Go to "Application Pools"
3) Select the required application and on the right panel choose "Advanced Settings"
4) Go to the "Process Model" section and change the "Identity" option to "Network service" or to "Custom account" (for the latter option you need to enter the username and password under which the application should run).
After this, the error should disappear
Applies to: Windows Server 2008 R2; MS SQL Server 200x; IIS 7
Comments