Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Databasesets
Message
 
To
10/07/2007 15:14:50
Bill Oeftering
Mainstreet Computers, Inc.
Belleville, Michigan, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01239054
Message ID:
01239156
Views:
9
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
Previous
Reply
Map
View

Click here to load this message in the networking platform