Skip to content Skip to sidebar Skip to footer

Getting An Sql Connection String Error When Scaffolding In Ef Core?

For background info, I'm running .NET core on Arch Linux VScode and I also have SQL Server running on Arch Linux. When I connect to the server via sqlcmd or through the VScode SQL

Solution 1:

That is what I've been saying. I do not thing the Net error message are accurate. Net is trying to make a secure TCP connection using an IP address (name) and port number. The connection is not completing and Net is saying the error could be due to the service. TCP errors fail for four reasons 1) No Route to server 2) Port blocked 3) Server not listening 4) TLS/SSL failing for a secure connection.

From the Log file (LDF) we can tell the SQL Server never got the connection because there is no record of a login. I think it time to use a sniffer like wireshark of fiddler to see exactly where the connection is failing.

I do not know how to configure linux and suspect the setup is wrong. I'm not sure if using the same IP address for both linux and windows will work. Sending message are fine. But when an IP is received without having a different IP address for linux and Windows the Ethernet interface does not know whether to send and receive message up the Windows interface or Linux interface. It looks like the port number in this case will be used. Port 1433 for linux and port 1434 for windows. Using a sniffer would confirm. So I would first get the Net side working by using SSMS and get SSMS working which should solve the Net issue.

Solution 2:

I ran this and it just worked this time I guess:

dotnet ef dbcontext scaffold "Server=wasiim-PC;Database=ConkerDb;User Id=sa;Password=*********" Microsoft.EntityFrameworkCore.SqlServer -o Models -c ConkerDbContext -v

Post a Comment for "Getting An Sql Connection String Error When Scaffolding In Ef Core?"