Skip to main content

Posts

Showing posts from February, 2014

Strongly typed configuration through database

We usually save most of application setting under app.config or web.config with key and value pair under appSetting element. The big problem with those are whenever you need value, typecasting need to be done and also need to be called through key. The other problem I find is with hierarchy of settings like download related setting present should under download element for easy accessing. To solve strongly typed configuration and hierarchy, ConfigurationManager ( http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager(v=vs.110).aspx ) class comes for rescue. You might have seen under web.config where we have sectionGroup and related configuration under elements. To implement it, lot of codes need to written to achieve simplification. To reduce numbers of codes for implementing XML configuration a very good and free tool is available called "Configuration Section Designer" available on http://csd.codeplex.com/ . There we do not have to wri...