I saw many questions on SO with this error. But none were related to forms. I just hosted my application server after testing locally. I think it worked for a few mins but I
start the sql server agent, that should fix your problem
I had the same problem - for me it was the SQL Server running out of memory. Freeing up some memory solved the issue
Considering that a LocalDb instance only intended for use in development. LocalDb is not available for production servers When you deploy the final result.
I think your connection string is pointing to a LocalDb instance and you need to take certain steps to turn it into the SQL Server database. It's not just a matter of copying an mdf file either. It will possibly differ from one hosting company to another, but typically, you need to create a backup of your existing database (a .bak file) and then restore that to the hosting company's SQL Server. You should ask them where you can find instructions on deploying your database into production.
I got this error when starting my ASP.NET application and in my case the problem was that the SQL Server service was not running. Starting that cleared it up.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. text
Generally issues like this are related to any of the following need to be looked at:
Try connecting to sql server with sql management server on the system that sql server is installed on and work from there. Pay attention to information in the errorlogs.
The most common reason could be the database connection string. You have to change the connection string attachDBFile=|DataDirectory|file_name.mdf. there might be problem in host name which would be (local),localhost or .\sqlexpress.