public bool PingServer() { return(GetMySqlConnection.Ping()); }
public void OpenConnection() { try { // Check if the connection string is valid. if (GetMySqlConnection.ConnectionString == null) { return; } // Check if connection is already open. if (GetMySqlConnection.State == ConnectionState.Open) { return; } // If validated, open connection. GetMySqlConnection.Open(); Debug.WriteLine($"########## Should open connection: [{GetMySqlConnection.State}] <{GetMySqlConnection.Ping()}> ##########"); } catch (InvalidOperationException) { throw; } catch (MySqlException) { throw; } catch (Exception) { throw; } }