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: 40 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -2)
To fix the issue follow the below step;
Step# 1: Check the given Server Name is correct or not. if correct
Step# 2: Check "SQL SERVICE" state in "Sql Server Configuration Manager" or Services.msc it should be running, if it is stop state Right Click and start the "SQL SERVICE"service.
Command Prompt: To open "Sql Server Configuration Manager" - type SQLServerManager13.msc
OR
Open services.msc in run Start the "SQL SERVICE".