By using DBFirst approch i'm trying to connect to the database but this error occuring why is this?
did you check the things the error mentions?
16 Replies
Actually I'm new to learn .NETCore
this is why I can't understand this error
the things it tells you to check are not .NET related
I'm trying to use DB code first approch
yes, that is clear from your post title
what does the error tell you to check?
Server is configured to allow connection
and is your connection string correct?
and Scaffold-Dbcontext "Server=DESKTOP-U13V3A8\SQLSERVER2022DEV; Database=Company; Trusted_Connection=True; TrustServerCertificate=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
Yes
my connection string is correct I'm sure
but how to check Server is configured to allow connection?
plz help
can you connect to it with SSMS?
I can connect SSMS with database and created Employee table
But IDK why it's throwing error while scafolding
Created table

what do you get when you execute
SELECT @@servername
?in vs?
in your database
just a sec
I can select database not server sorry if I am wrong
USE Company;
I can execute above command
How to check if that SQL Server is configured to allow remote connections.

It is also connected
then what is an issue?
plz help
if you will then I will learn new thing today before I sleep