NOTE: You receive this error message specifically when you use integrated security (when you include the integrated security=sspi attribute in a connection string).
When you use ASP.NET, the default security context is the aspnet_wp for both aspnet_wp.exe and the request to SQL Server. By default, the aspnet_wp account does not have any permission in SQL Server, and therefore it cannot access the database.
Solution
To resolve this problem, use any of the following methods:
· Programmatically change the security context of the ASP.NET worker process to a user that has the proper SQL Server permissions.
-or-
· Change the default configuration of ASP.NET so that the ASP.NET worker process starts and runs under the context of a user who has the proper permissions in SQL Server.
-or-
· Grant the proper permissions on SQL Server so that the aspnet_wp account has the appropriate access to the needed resources.
Simple Solution:
The most appropriate & simple solution to this problem is to setup or install SQL server with only windows authentication & don’t use a mixed mode of windows & user authentication.
Notes
- When you want to link your ASP pages with a SQL database you must install SQL server for creating and developing your own database that will be linked with your web application, in this case you should install SQL server after the components that I have said before have already been installed.
- Install SQL server with only windows authentication
- If you already installed SQL server with only windows authentication, and this error is still displayed for you, In this case remove SQL server & then reinstall it (windows authentication mode); I think you are surprised of this notice but I tried this & after that ASP runs without any problems.
Briefly, you should install SQL server after installing the components needed to run web server.
For more information & more practical solution of this problem browse & see the following MSDN Web site link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-s/dnbda/html/authaspdotnet.asp