It is possible to method to alter the connection string of the DataBase object in Enterprise Library at runtime? I have found this link nevertheless its a bit outdated (2005)

I have also found this however it appears to use to .Internet generally, I'm wondering if there is something that may be done particularly for EntLib.

I had been just passing the bond string title towards the CreateDatabase() method in DatabaseFactory object which labored til yesterday that my project manager requested me to aid several database instance. It takes place that we must have one database per condition (one for CA, one for FL, etc...) so my software must cycle through all databases and make a move with data however it uses exactly the same config file.

Thanks ahead of time.

Should you have a look at "Enterprise Library Docs - Adding Application Code" it states this:

"Knowing the bond string for the database you need to create, you can bypass the application's configuration information and employ a constructor to directly produce the Database object. Since the Database class is definitely an abstract base class, you must construct among its derived types. The derived Database type determines the ADO.Internet data provider. For instance, the SqlDatabase class uses the SqlClientFactory provider, the SqlCeDatabase class uses the SqlCeProviderFactory provider, and also the OracleDatabase class uses the OracleClientFactory provider. It's your responsibility to create the appropriate kind of Database class for the bond string."

After that it continues to provide some good examples. This could suggest that you ought to 't be while using DatabaseFactory and you ought to be developing a new Database class for every of the different connections.

Here's from Yang's Internet Zone:

using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Data.Configuration;

DatabaseSettings settings = new DatabaseSettings();

// This maps to <databaseType> element in data config file
DatabaseTypeData type = new DatabaseTypeData("Sql Server", "Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=, Culture=neutral, PublicKeyToken=null");

// This maps to <connectionString> element in data config file
ConnectionStringData connectionString = new ConnectionStringData("localhost.EntLibQuickStarts");

// Followings map to <parameter> elements in data config file
ParameterData param = new ParameterData("server", "localhost");

param = new ParameterData("database", "EntLibQuickStarts");

param = new ParameterData("integrated security", "true");


// Too bad compiler gets confused InstanceData with System.Diagnostics.InstanceData.  It maps to <instance> element in data config file
Microsoft.Practices.EnterpriseLibrary.Data.Configuration.InstanceData instance = new    Microsoft.Practices.EnterpriseLibrary.Data.Configuration.InstanceData("localhost", "Sql Server", "localhost.EntLibQuickStarts");

ConfigurationDictionary configurations = new ConfigurationDictionary();

// This is how to tie DatabaseSettings with ConfigurationDictionary. It maps to <configurationSection name="dataConfiguration"> element in App.config file    configurations.Add("dataConfiguration", settings);
ConfigurationContext context = ConfigurationManager.CreateContext(configurations);

Database database = new DatabaseProviderFactory(context).CreateDatabase("localhost");