So something very strange happened with this old C# application I started to work on. I copied it locally and I've been studying the codebase without making any changes. In fact, it ran locally every day for the past week. Again, no code changes or changing in the configuration, etc. Today, I wasn't able to run it anymore. I even cloned a fresh copy - no luck. Now it's giving me this error and I don't know why. The database is remote but I can see that it's working when RDPing. What could cause this?
public static SqlConnection OpenSqlConnection(dbConnections connection, string applicationName = null)
{
var conn = CreateSqlConnection(connection, applicationName);
conn.Open();
return conn;
}
In this line, I get the following error:
System.Data.SqlClient.SqlException: '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)'