How to make sure a project Application setting reads from the config file?

Discussion in 'ASP .Net' started by Eric, Mar 6, 2007.

  1. Eric

    Eric Guest

    I inherited some code that uses the settings designer to manage some app
    settings. One of the settings is a connection string that has a
    DefaultSettingValueAttribute with hard coded text for a connection string. I
    would like it to read from the app.config file at runtime, but am not sure
    how to get it to do that. I tried putting in code to read the config
    section in the attribute instead of the text, but it didnt compile.

    If I open the settings in the designer it says the app.config has changed
    and do I want to update the default value, but that's not the same as
    reading it at runtime. I dont want to have to open the project in the
    designer and redeploy when I change the connection string in the app.config
    file.

    Is there a way to make it simply read the config file each time?

    Thanks,
    Eric
     
    Eric, Mar 6, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom Van Overbeke
    Replies:
    2
    Views:
    577
    Robrecht Jacques
    Jul 11, 2003
  2. Vikas
    Replies:
    0
    Views:
    827
    Vikas
    Jul 15, 2003
  3. Laco
    Replies:
    1
    Views:
    410
    mlimber
    Oct 20, 2006
  4. Replies:
    0
    Views:
    560
  5. ToddT
    Replies:
    0
    Views:
    506
    ToddT
    Oct 28, 2008
Loading...

Share This Page