示例#1
0
        public virtual void LoadConfig()
        {
            Configuration config = GetDBConfiguration();

            if (config != null)
            {
                DBConfigurationSection cfgSec = config.GetSection(ConfigurationKey) as DBConfigurationSection;
                nhConfigSection = cfgSec;
            }
        }
示例#2
0
        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);
        }
示例#3
0
 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();
 }