A simple solution to the error is to add a login to SQL Server for
IIS APPPOOL\ASP.NET v4.5
and grant appropriate permission to the database.Open SQL Server Management Studio > Right click ‘Security’ > New > Login
![iis-apppool-login iis-apppool-login](https://lh3.googleusercontent.com/-HmkoCXZruYo/Vcrrj_gsEwI/AAAAAAAAD9w/zoTryLyk6kg/iis-apppool-login%25255B5%25255D.png?imgmax=800)
In the dialog that appears, enter the app pool ‘IIS APPPOOL\AppPool4.5’ as the login name.
![sqlserver-apppool sqlserver-apppool](https://lh3.googleusercontent.com/-3SVGc85PsCU/VcrrnFeZ1WI/AAAAAAAAD94/uT9eVdspOlY/sqlserver-apppool%25255B3%25255D.png?imgmax=800)
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.
![usermapping usermapping](https://lh3.googleusercontent.com/-wFQoDXeLiKU/Vcrrnzuhs_I/AAAAAAAAD-A/ST0zWfUo53E/usermapping%25255B2%25255D.png?imgmax=800)
Click OK and try and browse the site again. The error should go away.
Tweet
No comments:
Post a Comment