void GenerateUsers() { var settings = new DatabaseSettings { DefaultDatabase = string.Empty }; var section = new ConnectionStringsSection(); ConfigurationSource.Add(DatabaseSettings.SectionName, settings); ConfigurationSource.Add("connectionStrings", section); foreach (var user in Users) { section.ConnectionStrings.Add(FormatConnectionString(user)); } //string OdbcProviderName = ((DatabaseSettings)keyItem.ConfigurationSource.GetSection(DatabaseSettings.SectionName)).CurrentConfiguration.ConnectionStrings.ConnectionStrings["defaultConnString"].ProviderName; }