internal SqlConnection CreateConnection() { var con = new SqlConnection(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 SqlCommand(sql.ToString(), con)) cmd.ExecuteNonQuery(); } return(con); }
public SqlServerEffectiveSettings GetEffectiveSettings() { var result = new SqlServerEffectiveSettings(); using (var con = CreateConnection()) result.Reload(con, null); return(result); }
private partial AbstractConnection OnCreateConnection() { var con = new SqlConnection(ConnectionString); con.Open(); if (DatabaseMetadata.ServerDefaultSettings == null) { var temp = new SqlServerEffectiveSettings(); temp.Reload(con, null); Thread.MemoryBarrier(); DatabaseMetadata.ServerDefaultSettings = temp; } var sql = BuildConnectionSettingsOverride(); if (sql != null) { using (var cmd = new SqlCommand(sql, con)) cmd.ExecuteNonQuery(); } return(con); }