I'm trying to publish a website on IIS with localDB (SQL Server 2012/v11.0), but it gives me this error:
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: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details.
On Visual Studio, it works well, but when it is published, it does this, all the time i access a page with a database embedded.
I modified the connections in the config file, I've added users into the access folder, modified parameter value, still nothing working.
There is my config file (all databases included are in the v11.0, i have v12.0 installed, as well):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings />
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Database1.mdf;Server=(LocalDB)\v11.0;Integrated Security=True" providerName="System.Data.SqlClient" />
<add name="connect" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Database2.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation targetFramework="4.5" />
<httpRuntime />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
<authentication mode="Forms" />
<identity impersonate="false" />
</system.web>
</configuration>
I'm using Windows authentication at the moment. Thank you in advance :)