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
  1. Home
  2. General Programming
  3. C#
  4. App.config or Resources.resx

App.config or Resources.resx

Scheduled Pinned Locked Moved C#
databasequestion
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.
  • V Offline
    V Offline
    Vandretta
    wrote on last edited by
    #1

    Should I use my app.config file or the Resources.resx in VS2008 to store the connection string for my DB? I am not sure which one would be better should I later on decide that I want to give the user the option to edit this.

    L 1 Reply Last reply
    0
    • V Vandretta

      Should I use my app.config file or the Resources.resx in VS2008 to store the connection string for my DB? I am not sure which one would be better should I later on decide that I want to give the user the option to edit this.

      L Offline
      L Offline
      Lev Danielyan
      wrote on last edited by
      #2

      The resx files are being compiled into your assembly, so you'll not be able to change stuff in it without recompile. If you plan to give users possibility to change the stuff choose appconfig

      Regards, Lev

      V S 2 Replies Last reply
      0
      • L Lev Danielyan

        The resx files are being compiled into your assembly, so you'll not be able to change stuff in it without recompile. If you plan to give users possibility to change the stuff choose appconfig

        Regards, Lev

        V Offline
        V Offline
        Vandretta
        wrote on last edited by
        #3

        Ok, Thankyou very much! I'll do that.

        1 Reply Last reply
        0
        • L Lev Danielyan

          The resx files are being compiled into your assembly, so you'll not be able to change stuff in it without recompile. If you plan to give users possibility to change the stuff choose appconfig

          Regards, Lev

          S Offline
          S Offline
          Simon P Stevens
          wrote on last edited by
          #4

          Lev Danielyan wrote:

          If you plan to give users possibility to change the stuff choose appconfig

          I agree with this recommendation. If it's a setting you want the user to be able to configure use the app.config file. resx files are for more fixed resources that only you provide.

          Lev Danielyan wrote:

          so you'll not be able to change stuff in it without recompile

          Not quite strictly true. Resources can be compiled into satellite assemblies so you can provide a new set of resources without recompiling the app. (This is mainly used for things like internationalisation & localisation. a satellite assembly will be produced for all the different languages the app is used in).

          Simon

          L 1 Reply Last reply
          0
          • S Simon P Stevens

            Lev Danielyan wrote:

            If you plan to give users possibility to change the stuff choose appconfig

            I agree with this recommendation. If it's a setting you want the user to be able to configure use the app.config file. resx files are for more fixed resources that only you provide.

            Lev Danielyan wrote:

            so you'll not be able to change stuff in it without recompile

            Not quite strictly true. Resources can be compiled into satellite assemblies so you can provide a new set of resources without recompiling the app. (This is mainly used for things like internationalisation & localisation. a satellite assembly will be produced for all the different languages the app is used in).

            Simon

            L Offline
            L Offline
            Lev Danielyan
            wrote on last edited by
            #5

            Right, but you will still need to recompile the satellite assemblies ;)

            Regards, Lev

            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