Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hiding Connection String
Message
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01107011
Message ID:
01107036
Views:
27
Figured out a very simple way thanks to the design of the MM framework (Kudos Kevin!) Didnt have to use new dataaccess class.


Created a new database manager and overrode the GetConnectionString method. I only have one connectionstring in my app, so i didnt need to check the database key
public class DMSDatabaseManager:OakLeaf.MM.Main.Managers.mmDatabaseManager
{
   public override string GetConnectionString(string databaseKey)
   {
        return "server=xx;.......";
   }
}
Next I overrode the CreateDatabaseManager to instantiate the class above in the Factory in Factory.cs
public class Factory : OakLeaf.MM.Main.Windows.Forms.mmFactoryDesktop
{
	public override mmDatabaseManager CreateDatabaseManager()
	{
		DMSDatabaseManager oDBMgr = new DMSDatabaseManager();
		return oDBMgr;
	}

}
And further, I put the DMSDatabaseManager into a separate project by itself, so if the connection string ever changes, all I need to do is change, rebuild and deploy just the one dll instead of the entire app.
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform