string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "database.config");
IConfigurationSource configurationSource = new FileConfigurationSource(path);
DatabaseFactory.SetDatabaseProviderFactory(new DatabaseProviderFactory(configurationSource));
DatabaseFactory.CreateDatabase().CreateConnection().Open();