I am learning ASP.NET core 6 Multitier architecture. I tried making connection to database but I keep getting this error:
Error Number:4060,State:1,Class:11
Cannot open database "Blogging" requested by the login.
The login failed.
Login failed for user 'TECHRITOMA\TECHRITOMA Inc'.
I tried using the command :
Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
and i was expecting the model class to be created.
As Sydney_dev said. First, Visual studio needs to successfully connect to the local database. Official document: SQL Server Express LocalDB.
.NET Core+EF Scaffold-DbContext command uses.
Official document.