A simple solution to the error is to add a login to SQL Server for
IIS APPPOOL\ASP.NET v4.5and grant appropriate permission to the database.
Open SQL Server Management Studio > Right click ‘Security’ > New > Login
In the dialog that appears, enter the app pool ‘IIS APPPOOL\AppPool4.5’ as the login name.
Click on OK.
Now expand Logins in SSMS and select this newly created login. Right Click > Properties. Click on User mapping and map this login to the database you want to provide access to.
Also select the appropriate roles for this user. I have selected db_datareader and db_datawriter.
Click OK and try and browse the site again. The error should go away.