public class ABusinessObject : mmBusinessObject { protected string DatabaseSetKey; /// <summary> /// Constructor /// </summary> public ABusinessObject() { this.DatabaseKey = "Northwind"; this.RetrieveAutoIncrementPK = true; } public void SetDatabaseSetKey(string databaseSetKey) { this.DatabaseSetKey = databaseSetKey; mmDataAccessBase dao = this.GetDataAccessObject(); if (dao != null) { dao.DatabaseSetKey = databaseSetKey; } } public override mmDataAccessBase GetDataAccessObject() { mmDataAccessBase dao = base.GetDataAccessObject (); if (this.DatabaseSetKey != null) { dao.DatabaseSetKey = this.DatabaseSetKey; } return dao; } }Then when you instantiate your business object in a web page you can retrieve the correct database set key and call the business object's SetDatabaseSetKey() method. For example:
this.oInventory = new Inventory(); this.oInventory.SetDatabaseSetKey("DATABASE SET VALUE");Now when the data access object is instantiated (which happens the first time you try to access data), the GetDataAccessObject() method will set the data access object's DatabaseSetKey property to the correct value for the current user.