I can't get a connection between C# and SQL Server.
I have two Windows servers (1 with SQL Server, 1 with the application).
I get this error:
System.Data.Entity.Core.EntityException: The underlying provider failed on Open
System.Data.SqlClient.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: 26 - Error Locating Server/Instance Specified)
I think there is something wrong with my connection string...
The setup worked on localhost with 0 problems.
I have a 1:1 copy of the SQL Server database on my server.
I have a two Windows server setup. I already opened the inbound rules port 1433 on the ms sql server and opened the outbound port 1433 for application server. I added the user in SQL Server and tried different connection strings. I don't know what's wrong.
Please help best regards
<connectionStrings>
<add name="XXX_DATA_DEVEntities4"
connectionString="metadata=res://*/Entities.csdl|res://*/Entities.ssdl|res://*/Entities.msl;provider=System.Data.SqlClient;provider connection string="data source=XX.XXX.XXX.XXX\Servername\MSSQL2017STD;initial catalog=XXX_DATA_DEV; Persist Security Info=False;User ID=usernam;Password=password;multipleactiveresultsets=True;application name=EntityFramework""
providerName="System.Data.EntityClient" />
</connectionStrings>