Connect to external SQL Server through Entity Framework

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

Question

Basically I need to test a database on an external server (the model matches the model of my local test database).

Here is the connection string I have so far:

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

When I attempt to connect now I get the generic error:

The underlying provider failed on Open.

Inner exception 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 be just Server=12.345.678.901\SQLExpress in your connection string ( replace "\SQLExpress" with the relevant 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