Irakli Lekishvili
Irakli Lekishvili

Reputation: 34158

Simple Advice where to save setting

Im programming C# WinForm application which have big SQL Server Database. I need to make setting. I dont know how to save application setting. Which is better just add my solution .setting file or save in database Table?

Upvotes: 2

Views: 208

Answers (4)

bAN
bAN

Reputation: 13825

You edit: (have) (sure you don't have, sorry for my poor english ....) you can to store configuration in the app.config file. Here's a post about using configurations files. Informations will be accessible by the Configuration manager (Msdn link) Class.

Upvotes: 1

Silx
Silx

Reputation: 2691

Depend of your needs, when use app.settings (tutorial http://msdn.microsoft.com/en-us/library/ms143432.aspx ) file it will be stored with application itself, when you strore them in database is more accessible.

Upvotes: 2

Marc Gravell
Marc Gravell

Reputation: 1062745

I hate to say it, but it depends on whether the setting is intended to span all clients to the database, vs whether different nodes/applications would require different values. Having the values in the database can make it easier to centrally configure the system via the system itself (an admin page), without needing to re-deploy or reconfigure any nodes.

Disconnected clients can also work either way, as long as they capture the settings locally when connected (being able to connect at least once is not unreasonable).

Of course, even per-node settings can be in the db if you add suitable dimensions to the table. The one setting that is a pain, of course, being the connection details...

Upvotes: 4

bhu1st
bhu1st

Reputation: 1318

use application configuration file to save your app wise settings.

Upvotes: 3

Related Questions