Login failed for "IIS AppPool\ASP.NET v4.0" - SQL Server Web

IIS 7 is trying to use the IIS application pool identity to access your SQL database.

So you must first grant the IIS 7 apppool access to SQL server.

To do that, go in SQL Server Management Studio -> Server Instance -> Security -> Logins -> New Login

Login name will be "IIS APPPOOL\ASP.NET v4.0". This is because everytime you create an application pool in IIS7, it will create an identity which uses the same name as your app pool. In your case, you are using the default app pool which comes with asp.net 4.

Then on your database, go to Security -> Logins -> New login , give it a alias name, then select your user object you added in your previous step (IIS APPPOOL\ASP.NET v4.0) then give it db_owner (or whatever your needs are) schemas/role privileges.