I have an ASP.NET app, and when I launch the app from Visual Studio 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_'.
I use SQL SERVER MANAGEMENT STUDIO, in login I have DESKTOP-KRBN07G\juan_
with the table checked in User Mapping and db_owner
checked as role. I also added a user DESKTOP-KRBN07G\juan_
to that DB.
I can connect to the DB from Visual Studio and SSMS.
I'm new in the backend and I don't know how to fix this or what should I check, I get some scripts from chatGTP attempting to get some info, I run those script in SSMS and I get this:
In my appSettings.json file I use:
"ConnectionStrings": {
"Appointments": "Data Source=DESKTOP-KRBN07G;
Initial Catalog=appointments;Integrated
Security=True;
Trust Server Certificate=True"
}
A colleague tried the app on his local development environment and didn’t get the error. I’m not sure what I should check or what to do.