Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Databasesets
Message
 
À
10/07/2007 15:14:50
Bill Oeftering
Mainstreet Computers, Inc.
Belleville, Michigan, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01239054
Message ID:
01239156
Vues:
8
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform