Hi,
I have multiple databases - one for each "company", say A, B and C. Each of these databases have the exact same schema, but their data is different. Now when the user selects a particular company from a dropdown, I would want to be able to connect to that company's database and fetch data.
This is how much I've achieved:
1. I have created a LLBLGen project using company A's database.
2. In my web.config, I have a generic connection string as:
<add key="Generic.ConnectionString" value="Server=server1;initial catalog={0};integrated security=SSPI;persist security info=False;packet size=4096"/>
- In my aspx, I construct the actual connection string with the above key and the include the database name as below:
A.HelperClasses.DbUtils.ActualConnectionString = string.Format(GenericConnectionString, Company.DatabaseName);
Company.DatabaseName is derived from the drop down list.
But when I try something like:
CompanyOrderCollection Orders = new CompanyOrderCollection();
Orders.GetMulti(null);
I'm getting the orders from company A, instead of B.
What's wrong?
Thanks for any help
Arun