Connect to external SQL Server through Entity Framework

connection-string database-connection entity-framework entity-framework-6 sql-server

Question

In essence, I must test a database on an outside server (the model matches the model of my local test database).

The connection string I now have is as follows:

<connectionStrings>
   <add name="DefaultConnection" 
        connectionString="Database=QualityLinkBuilder;Server=12.345.678.901.\SQLExpress;uid=RemotePc\Administrator;pwd=MyPassword;" 
        providerName="System.Data.SqlClient" />
</connectionStrings>

Now, whenever I try to connect, I encounter the following error:

The underlying provider failed on Open.

Internal error message:

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)

1
1
11/1/2015 11:09:33 PM

Popular Answer

It should only beServer=12.345.678.901\SQLExpress Replace "SQLExpress" in your connection string with the appropriate SQL Server instance name on the external server.

0
11/1/2015 9:47:15 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow