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

 string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "database.config");
 IConfigurationSource configurationSource = new FileConfigurationSource(path);
 DatabaseFactory.SetDatabaseProviderFactory(new DatabaseProviderFactory(configurationSource));
 DatabaseFactory.CreateDatabase().CreateConnection().Open();
posted @ 2016-09-05 20:02  GUOKUN  阅读(265)  评论(0编辑  收藏  举报