Switching databases easily in app.config

Topics: General discussion
Apr 8, 2010 at 11:49 PM

Hi, we're currently migrating from EL 1.1 to El 4.1 and we're having problems duplicating some functionality that we used in the earlier version of EL. In the earlier version we had an app.config file which pointed to a dataconfig.config file. When we needed to change database environments,  we simply edited the dataconfig file to point to the new database. We also had a special production version of the dataconfig that was encrypted and used for production. (requiring a key in the app.config to be changed to use the encrypted file). This works well for us as our QA team are not programmers and can easily change their environments using a text editor and a file copy.

Is it possible to store the dataconfig keys in a file separate from the app.config, or duplicate the ability to easily switch between environments (using encrypted/non encrypted keys) without having to use the EL Config tool. One idea that comes to mind is having multiple sections in the app.config named for each db environment and changing some other key to indicate which to use as the default database.




Apr 12, 2010 at 7:15 AM

That sounds like a lot of work stoned99.  Why need to duplicate a simple approach?  What's the need for another file to store the keys?  Anyway, creating multiple sections would still require code changes I think to the entlib source code as you must be able to tell the DatabaseFactory.CreateDatabase to use the default database you specified in the "other key" you used to indicate it.