Beispiel #1
0
        internal OleDbConnection CreateConnection()
        {
            var con = new OleDbConnection(ConnectionString);

            con.Open();

            if (m_ServerDefaultSettings == null)
            {
                var temp = new OleDbSqlServerEffectiveSettings();
                temp.Reload(con, null);
#if !Thread_Missing
                Thread.MemoryBarrier();
#endif
                m_ServerDefaultSettings = temp;
            }

            var sql = BuildConnectionSettingsOverride();

            if (sql.Length > 0)
            {
                using (var cmd = new OleDbCommand(sql.ToString(), con))
                    cmd.ExecuteNonQuery();
            }

            return(con);
        }
Beispiel #2
0
        public OleDbSqlServerEffectiveSettings GetEffectiveSettings()
        {
            var result = new OleDbSqlServerEffectiveSettings();

            using (var con = CreateConnection())
                result.Reload(con, null);
            return(result);
        }
Beispiel #3
0
    private partial AbstractConnection OnCreateConnection()
    {
        var con = new OleDbConnection(ConnectionString);

        con.Open();

        if (m_ServerDefaultSettings == null)
        {
            var temp = new OleDbSqlServerEffectiveSettings();
            temp.Reload(con, null);
            Thread.MemoryBarrier();
            m_ServerDefaultSettings = temp;
        }

        var sql = BuildConnectionSettingsOverride();

        if (sql != null)
        {
            using (var cmd = new OleDbCommand(sql, con))
                cmd.ExecuteNonQuery();
        }

        return(con);
    }