Use ini/appconfig file or sql server file to store user config?

My general approach is to put user configuration entries in to a database (centralised in our case, but equally applicable as a local store).

My general approach is to put user configuration entries in to a database (centralised in our case, but equally applicable as a local store). However, there are exceptions to this and I store the following in a text-based file (app. Config usually): Details of how to connect to the database (I prefer to have this in the config file, rather than use a convention).

Any setting that could potentially stop the application from starting correctly. If there are settings that could 'break' the startup, the user should be able to access them without using the software -- at a text-based storage is best. In code, I write a single configuration class that 'knows' whether a configuration entry is stored in the text file, or in the database; this allows me to move a configuration from one to the other without breaking all references to it.Herbie.

It really depends on the architecture of your application. For example, if you're creating a web app, then you'll want to store the user settings in the database since the whole user/role system would be stored in the database anyway. If it's just a simple desktop application used on individual machines with no interaction between the copies of the software, then you could use an XML file to store settings -- using a database might be overkill, especially if you're not using a database for anything else.

There are advantages and disadvantages to both methods, of course. If you use a database, that means there's a lot more setup steps involved in deployment (again, dependent on your architecture), while using a simple config file is more lightweight and can be moved around easily. One thing to note: if you go the database route, you will need to use a config file anyway to store the information needed to connect to the database.

I often store user preferences in a centralised database, as this means a user's setting can 'roam' from PC to PC. Another plus is that user preferences are being backed up.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions