|
-
Aug 18th, 2009, 02:46 PM
#1
Thread Starter
Lively Member
[RESOLVED] Saving global application settings.
I am writing a Client/Server application with an SQL backend. I am having some trouble figuring out how to store some common application wide settings in the database.
For instance. I need to save a password for gaining access to the "Admin Console". The way I am doing it now is a dedicated table that has only a single row with a column for each setting. This is method seems yukky to me.
I thought about using my.settings avaliable in the .NET framework, but these settings will not work there because each station has to use these same settings, and my.settings can differ per installation.
Perhaps a better method is to create a Settings table with a text "Setting" column, and text "Value" column. So it would store those individual settings like that.
That seems like a much better method than what I am doing now at least. What do you think?
-
Aug 26th, 2009, 06:34 AM
#2
Member
Re: Saving global application settings.
You could use one table for users, and one table for settings.
Your users table would need a unique id for each user, but you could store if there are a admin or not. Then for settings use something like this.
UID | User ID | Setting Name | Value
1 | 2 | lockdesktop | true
2 | 52 | backgroundcolor | blue
-
Aug 27th, 2009, 12:49 AM
#3
Thread Starter
Lively Member
Re: Saving global application settings.
I like your idea if I do need to save user settings. I am saving application wide settings though so no user ID is needed, but it looks similar. Just a SettingName, and Value. Would a UID really be needed? The lookup would have to be by SettingName so index by UID would not help much I dont think. Could be wrong though its been known to happen.
Thanks.
-
Aug 27th, 2009, 02:19 AM
#4
Member
Re: Saving global application settings.
Well, if you plan on having more than one user then you will need a way to keep settings unique for each user.
i.e.
User 1 likes a blue background
User 2 likes a red background
So if you save the same settings with out telling each us apart, then the settings will be the same for ever user.
Now if you don't need/want to have users registered with a username/password, then maybe each copy of your program will create a serial number. Then each user can still have settings, but tied to that copy of the program.
-
Aug 28th, 2009, 08:37 PM
#5
Thread Starter
Lively Member
Re: Saving global application settings.
Currently I dont have any user settings in my application or need them right now. If I do I know how to do it though, but these settings are just for global settings. Just to be a little more clear this is not a web application just a vb.net forms application that has an SQL backend.
-
Aug 29th, 2009, 02:58 AM
#6
Member
Re: Saving global application settings.
I figured it wasn't for a web app. What I hope that you realize is, that once you get more than use user storing settings remotely you will need a way to keep all the settings separate for each user. This goes for stand alone apps as well as web apps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|