Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Config File with multiple profiles..

Config File with multiple profiles..

Scheduled Pinned Locked Moved .NET (Core and Framework)
databasetestingbeta-testingtoolsjson
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    programmervb netc
    wrote on last edited by
    #1

    I am trying to emulate the way that many sql front end tools save profiles of connection information. For instance the user sees my log on form and has a drop down to select "Testing", "Development", "Production" etc and when they select one of the profiles the rest of the information is populated. It would be easy to do this in a table but I am trying to do so using a configuration file so that the entire solution will be self contained without the need for tables. Any insight into how I might do this would be appreciated. Humble Programmer

    L realJSOPR 2 Replies Last reply
    0
    • P programmervb netc

      I am trying to emulate the way that many sql front end tools save profiles of connection information. For instance the user sees my log on form and has a drop down to select "Testing", "Development", "Production" etc and when they select one of the profiles the rest of the information is populated. It would be easy to do this in a table but I am trying to do so using a configuration file so that the entire solution will be self contained without the need for tables. Any insight into how I might do this would be appreciated. Humble Programmer

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      programmervb.netc++ wrote:

      For instance the user sees my log on form and has a drop down to select "Testing", "Development", "Production" etc and when they select one of the profiles the rest of the information is populated. It would be easy to do this in a table but I am trying to do so using a configuration file so that the entire solution will be self contained without the need for tables.

      I'd go for a business-class that contains said profile, and serialize that. Save the serialized string under it's profiles name in the configurationfile, and restore it when required. What type of configuration-file is it actually? Are you referring to the "Settings" tab on the project-page, or is this coming from an ini-file?

      I are Troll :suss:

      P 1 Reply Last reply
      0
      • L Lost User

        programmervb.netc++ wrote:

        For instance the user sees my log on form and has a drop down to select "Testing", "Development", "Production" etc and when they select one of the profiles the rest of the information is populated. It would be easy to do this in a table but I am trying to do so using a configuration file so that the entire solution will be self contained without the need for tables.

        I'd go for a business-class that contains said profile, and serialize that. Save the serialized string under it's profiles name in the configurationfile, and restore it when required. What type of configuration-file is it actually? Are you referring to the "Settings" tab on the project-page, or is this coming from an ini-file?

        I are Troll :suss:

        P Offline
        P Offline
        programmervb netc
        wrote on last edited by
        #3

        The "config" file I was going to use was under the settings tab. You are talking a little above my head I will research serialization and config files and try to get a better idea of what you mean. Thank you Humble Programmer

        L 1 Reply Last reply
        0
        • P programmervb netc

          I am trying to emulate the way that many sql front end tools save profiles of connection information. For instance the user sees my log on form and has a drop down to select "Testing", "Development", "Production" etc and when they select one of the profiles the rest of the information is populated. It would be easy to do this in a table but I am trying to do so using a configuration file so that the entire solution will be self contained without the need for tables. Any insight into how I might do this would be appreciated. Humble Programmer

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4

          This might be of some help: Overriding App.Config Settings for Multiple Objects[^] No guarantees, but...

          ".45 ACP - because shooting twice is just silly" - JSOP, 2010
          -----
          You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
          -----
          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

          1 Reply Last reply
          0
          • P programmervb netc

            The "config" file I was going to use was under the settings tab. You are talking a little above my head I will research serialization and config files and try to get a better idea of what you mean. Thank you Humble Programmer

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            MSDN[^] has a nice example (bottom of the page) that shows how to "save" the contents of an object to a file and how to reload it. I wouldn't bother researching ini-files though, they're more a thing from the past.

            I are Troll :suss:

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups