first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

C# Code in Cold Storage: ConnectionStringIsValid()

private static bool ConnectionStringIsValid(SqlConnection SqlCnn, string ConnectionString) { /* FUNKYKB: The connection string is parsed immediately after being set. If errors in syntax are found when parsing, a runtime exception, such as ArgumentException, is generated. Other errors can be found only when an attempt is made to open the connection.

            In ADO.NET 2.0 this procedure is replaced by the
            SqlConnectionStringBuilder.
        */
        bool success = false;

        if (SqlCnn.State == ConnectionState.Open) return success;

        SqlCnn.ConnectionString = ConnectionString;
        success = true;

        return success;
    }
mod date: 2006-05-09T22:12:30.000Z