Quite simply, what is the correct connection string to an mdf file database located in the App_Data directory of my asp.net website hosted on Godaddy? Naturally this works offline in my developer environment but causes problems when uploading to Godaddy. Does Godaddy support connecting to databases contained within the App_Data directory? I suspect my problem is the Data Source portion and selecting a SQL Server instance but I'm not sure.
I clear the "LocalSqlServer" connection before adding the actual connection string info first.
<connectionStrings>
<remove name="LocalSqlServer"/>
<clear/>
And here's what I've tried with varrying errors:
1.
<add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="|DataDirectory|\DatabaseFileName.mdf";Initial Catalog="DatabaseFileName";Integrated Security=True" providerName="System.Data.SqlClient" />
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: 26 - Error Locating Server/Instance Specified)
2.
<add name="LocalSqlServer" connectionString="Data Source=(LocalDb)\v11.0;AttachDbFilename="|DataDirectory|\DatabaseFileName.mdf";Initial Catalog="DatabaseFileName";Integrated Security=True" providerName="System.Data.SqlClient" />
Error: [SqlException (0x80131904): 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: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]
3.
<add name="LocalSqlServer" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=DatabaseFileName;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\DatabaseFileName.mdf" />
Error. Same as number 2 above.
Many many thanks for assistance on this!