Hi Walaa,
This is the way I've got it to work.
The connection string in web.config looks like this:
<add key="Main.ConnectionString" value="Server=TREMOR;initial catalog={0};integrated security=SSPI;persist security info=False;packet size=4096"/>
For purpose of testing, I have the following:
DatabaseArray[0] = "MCFC";
DatabaseArray[1] = "MCFCA";
DatabaseArray[2] = "MCFT";
DatabaseArray[3] = "MCFW";
int CompanyID = int.Parse(CompanyDropDownList.SelectedValue);
string ConnectionString = string.Format(ConfigurationManager.AppSettings["Main.ConnectionString"], DatabaseArray[CompanyID]);
DataAccessAdapter daa = new DataAccessAdapter(ConnectionString, false, CatalogNameUsage.ForceName, DatabaseArray[CompanyID]);
Please let me know if there's a better way to do so.
Thanks
Arun