Bill,
>We have a web application that hosts multiple companies with a separate database for each. I use the databasesets and databases entries in the config file for this. On the home page I added a dropdown to pick the database set. I use the code: mmAppBase.DatabaseMgr.DatabaseSetKey=this.cboCompany.SelectedValue. This works fine at first but mmAppBase.DatabaseMgr.DatabaseSetKey seems to change at random. Is mmAppBase.DatabaseMgr.DatabaseSetKey shared ? It it possible other web sessions are changing this ? Thanks
Definitely! When you are working in a stateless environment such as the web, you are going to have to pass the "current company" information to each business object so it knows which database key to use. Most folks do this in the constructor of the business object (and don't allow a parameterless default constructor so it is ALWAYS passed to the business object).
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com