Hosted website won't start with SQL Server connection
I have developed an ASP.Net Web Forms website on my local computer.
I installed SQL Server Express 2017 on the local computer.
I have a SQL Server database connected to SQL Server Express using the following code in web.config:
connectionStrings
add name="DefaultConnection"
connectionString="Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog=mjbdevor_llannerchwen;AttachDbFilename=|DataDirectory|\mjbdevor_llannerchwen.mdf;Integrated Security=SSPI"
providerName="System.Data.SqlClient"
/connectionStrings
I can start the website OK from Visual Studio and log in to the database.
I have a copy of the website on a hosted server.
In the control panel I created an empty database linked to this website and with a default user.
I added the following code to the web.config file on the hosted server:
connectionStrings
add name="DefaultConnection" connectionString="server=sql11.hostinguk.net;database=mjbdevor_llannerchwendata;uid=edihelp01;password=Thomas1906#;
/connectionStrings
I tried going to the hosted website in the browser of my local computer and got this error:
Internal server error 500 There was a problem with the resource are looking for and it cannot be displayed. With no connection string code I get no such error.
I would appreciate if anyone can tell me where I have gone wrong. I removed the angle brackets in the code so that this message could be sent.