by Jeremy Canfield | Updated January 1st, 2017
Follow these directions to fix error 'Cannot open database requested by the login" in Visual Studio.
- Sign into SQL Server Management Studio (SSMS) using Windows Authentication.
- In Object Explorer, expand Security.
- Right-click on the Logins folder and select New Login.
- In the Login - New pop-up box, type IIS APPPOOL\\ASP.NET v4.0 in the Login name field.
- Select User Mapping. Check-mark the databases being used in Visual Studio, and also check-mark db_reader and db_writer.
- Select OK.