Connection String Works from Mac but not directly in Parallels - connection-string

So I have a connection string from a .NET Core application attempting to connect to a database that is sat on a Parallels Windows VM. When I spin the app up using Visual Studio for Mac it can connect with no issues, I use the same connection string from the VM using Visual Studio from Windows and it won't connect to the database.
Here's the connection string:
Server=10.211.55.3,5171;Persist Security Info=True;User ID=sa;Password=<password>;Initial Catalog=Hub.Database;
The IP address it's connecting to there is the IP of Windows VM. Not sure why this would work in one place but not another.
Error message I'm getting is:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified

Related

My app won't connect to SQL Server while in diferent subnet

I'm struggling to connect my app to a SQL server whitch is in another subnet. I'm using connection string like that:
192.168.2.xxx\nameOfTheInstance
and everything works fine from the same subnet, but if my PC has ip adress like 192.168.3.1/24 my app won't connect to the server. Oddly, when i use the same exact connection string in ssms in the same PC configuration, it works perfectly well.
We've eliminated network specific errors, so it has to Windows Firewall or some server setting that i don't know of.
Server is Windows Server 2019 (1809) on a phisical machine, and client can be literaly every Windows PC.
A network-related or instance-specific error occurred while establishing a connection to SQL Server.
The server was not found or was not accessible. Verify that the instance name is correct and that SQL
Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 -
Error Locating Server/Instance Specified)
Never mind. SQL server browser was answering from second nic. Problem solved.

How do you connect to a SQL Server database from within a dev container?

I'm currently working on a .NET Core project. When I run the application on my local machine (Windows) I can connect to a SQL Server database using my windows credentials.
I am attempting to shift into using a devcontainer within Visual Studio Code, but when I run the same application in the container (Linux) I get an error:
An exception of type 'Microsoft.Data.SqlClient.SqlException' occurred
in Microsoft.Data.SqlClient.dll but was not handled in user code:
A network-related or instance-specific error occurred while establishing
a connection to SQL Server. The server was not found or was not
accessible. Verify that the instance name is correct and that SQL
Server is configured to allow remote connections. (provider: TCP
Provider, error: 35 - An internal exception was caught)
I'm not sure where to go from here. What did I miss?

How to connect to SQL Server from visual studio Mac?

I tried to connect to a remote SQL Server using visual studio Mac using this
"Server=PcName;Database=DatabaseName;user=eg;password=password;MultipleActiveResultSets=true"
but cannot connect this and this error appears from terminal in Mac:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: TCP
Provider, error: 35 - An internal exception was caught)
Is this way correct? If not which is the right way?
Use Azure Data Studio, this is ssms for non windows machines.
Your connection is correct,Try restarting your sql server and agent...

How to test connection to MS SQL server running on Parallels on Mac OS?

I am using visual studio for Mac and I have my sql server instance running on windows 10 using parallels. I enabled port 1433 in the inbound rules in the firewall and enabled the browser agent in my Sql config. as mentioned here. I am running my app using this connection string
"DefaultConnection": "Server=smb://10.211.55.4/WINDOWS10PRO;Database=aspnet-Testapp-53bc9b9d-9d6a-45d4-8429-2a2761773502;Trusted_Connection=True;MultipleActiveResultSets=true"
but I am getting SqlException
SqlException: A network-related or instance-specific error occurred
while establishing a connection to SQL Server. The server was not
found or was not accessible. Verify that the instance name is correct
and that SQL Server is configured to allow remote connections.
(provider: SQL Network Interfaces, error: 25 - Connection string is
not valid)
How can I test my connection to the database using Mac OS ?

Unable to connect SQL Server from a PC while it is accessed from other PC

I try to search my problem and found lots of threads, but all of them server related. All suggestion/tips regrading Database server related.
I have a database server (SQL Server 2014) hosted on VPS. Server is running fine without any issue, and working fine from all computer over internet. But from one PC it is not connecting. I disabled antivirus, added program on exception list on firewall,but still I am unable to connect the server, while that server are access from other PC. This PC connecting on internet through cable internet connection and operating system is Windows 7 Ultimate (I called service provider, and confirmed that they are not blocking/filtering any IP).
Thanks in advance.
Error Details:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

Resources