Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Override the GetConnectionString Method - SqlCE
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Divers
Thread ID:
01245516
Message ID:
01246648
Vues:
26
This message has been marked as the solution to the initial question of the thread.
Mat,

>This works great for all of my business objects, but I am having a problem with the Login Form. Since the Users business object is not based on Abusiness, it does not see the overrided method. So my application works fine if disable Login, but how do I resolve this issue?

To make a global change that affects all business objects you can instead override the Database Manager's GetConnectionString() method (which is called by your business objects and all Framework-level objects too). Just create a subclass of mmDatabaseManager (for example, mmDatabaseManager) and override the GetConnectionString() method. Afterwards, override the CreateDatabaseManager() method in your project's Factory class and have it instantiate myDatabaseManager. For example:
public class Factory : OakLeaf.MM.Main.Windows.Forms.mmFactoryDesktop
{
   public override OakLeaf.MM.Main.Managers.mmDatabaseManager CreateDatabaseManager()
   {
      return new MyDataBaseManager();
   }
}
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform