/// <summary> /// Returns whether a database connection can be established using the specified database connection string /// </summary> /// <param name="connectionstring">Database connection string</param> /// <returns></returns> public static bool CanConnect(string connectionstring) { IDbConnection connection = CreateConnection(connectionstring); bool _connected = connection.CanConnect(); if (connection.State != ConnectionState.Closed) { connection.Close(); } connection.Dispose(); Materia.RefreshAndManageCurrentProcess(); return(_connected); }
/// <summary> /// Returns whether a database connection can be established using the specified database connection object. /// </summary> /// <param name="connection">Database connection object.</param> /// <returns></returns> public static bool CanConnect(IDbConnection connection) { return(connection.CanConnect()); }
/// <summary> /// Returns whether a database connection can be established using the specified database connection object. /// </summary> /// <param name="connection">Database connection object.</param> /// <returns>True if a database connection can be established otherwise false.</returns> public static bool CanConnect(IDbConnection connection) { return connection.CanConnect(); }