Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Override the GetConnectionString Method - SqlCE
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01245516
Message ID:
01246648
Views:
25
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform