EnterpriseLibrary 6.0中DAAB独立数据库配置文件初始化

时间:2024-06-26 18:07:32
 string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "database.config");
 IConfigurationSource configurationSource = new FileConfigurationSource(path);
 DatabaseFactory.SetDatabaseProviderFactory(new DatabaseProviderFactory(configurationSource));
 DatabaseFactory.CreateDatabase().CreateConnection().Open();