Results 1 to 6 of 6

Thread: [RESOLVED] Saving global application settings.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    84

    Resolved [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?

  2. #2
    Member
    Join Date
    Mar 2006
    Posts
    46

    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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    84

    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.

  4. #4
    Member
    Join Date
    Mar 2006
    Posts
    46

    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    84

    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.

  6. #6
    Member
    Join Date
    Mar 2006
    Posts
    46

    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
  •  



Click Here to Expand Forum to Full Width