Skip to content
Advertisement

Error while connecting to SQL Server. The server was not found or was not accessible

I am trying to connect to my SQL Server database. I am using C#. Here is my code:

But connection.Open() throws an error:

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: TCP Provider, error: 0).

My server is started, it allows remote connections and TCP/IP is enabled. Any ideas?

Advertisement

Answer

I found a solution. I created a server(Console Application) that connects to MySQL server. Then I connected my Xamarin/ASP.NET application to that server where I process queries.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement