public virtual void LoadConfig() { Configuration config = GetDBConfiguration(); if (config != null) { DBConfigurationSection cfgSec = config.GetSection(ConfigurationKey) as DBConfigurationSection; nhConfigSection = cfgSec; } }
protected DBConfigurationSection CreateConfigSection(string server, string sid, string user, string password, string database, bool trustedConnection = true) { DBConfigurationSection dbCfg = GetPlatformInstance(); dbCfg.Server = server; dbCfg.SID = sid; dbCfg.User = user; password = Convert.ToBase64String(Encoding.Unicode.GetBytes(password), Base64FormattingOptions.None); dbCfg.Password = password; dbCfg.Database = database; dbCfg.TrustedConnection = trustedConnection; return(dbCfg); }
public void AcceptConfig(string server, string sid, string user, string password, string database, bool trustedConnection = true) { this.nhConfigSection = CreateConfigSection(server, sid, user, password, database, trustedConnection); SaveConfig(); }