Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hiding Connection String
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01107011
Message ID:
01107036
Vues:
28
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform