Forum Discussion

juan_16_jh's avatar
juan_16_jh
Copper Contributor
Sep 13, 2024

Cannot open database requested by the login - "Error Number:4060,State:1,Class:11"

I have an ASP.NET app, and when I launch the app and try to list items from a table by accessing the corresponding route, I get this error:

 

SqlException: Cannot open database "appointments" requested by the login. The login failed. Login failed for user 'DESKTOP-KRBN07G\juan_'.

 

The database exists, and so do all the tables. I can connect to the database from SSMS and the 'Server Explorer' view in Visual Studio. I am using the connection string provided by the Server Explorer in Visual Studio. I also did a clean installation of Windows, Visual Studio, SQL Server, and SSMS. Currently, I have only one DB server and one database.


The error:

 

 
My VS and connection string:

 

Please help me; this error is driving me mad. If you need any extra info, please let me know.

 

 

No RepliesBe the first to reply

Resources