This contains the connection options that are currently in effect.
        /// <summary>
        /// Creates and opens a SQL connection.
        /// </summary>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns></returns>
        /// <remarks>
        /// The caller of this method is responsible for closing the connection.
        /// </remarks>
        private async Task<OleDbConnection> CreateConnectionAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            var con = new OleDbConnection(ConnectionString);
            await con.OpenAsync(cancellationToken).ConfigureAwait(false);

            if (m_ServerDefaultSettings == null)
            {
                var temp = new SqlServerEffectiveSettings();
                await temp.ReloadAsync(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))
                    await cmd.ExecuteNonQueryAsync();

            return con;
        }
 public async Task<SqlServerEffectiveSettings> GetEffectiveSettingsAsync()
 {
     var result = new SqlServerEffectiveSettings();
     using (var con = await CreateConnectionAsync())
         await result.ReloadAsync(con, null);
     return result;
 }
        internal OleDbConnection CreateConnection()
        {

            var con = new OleDbConnection(ConnectionString);
            con.Open();

            if (m_ServerDefaultSettings == null)
            {
                var temp = new SqlServerEffectiveSettings();
                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;
        }
 public SqlServerEffectiveSettings GetEffectiveSettings()
 {
     var result = new SqlServerEffectiveSettings();
     using (var con = CreateConnection())
         result.Reload(con, null);
     return result;
 }