SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2009
    Location
    Oklahoma, USA
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    storing data in webconfig - newbie question

    I have a small app I am building, where I would like to store about one dozen pieces of updatable data. I was thinking about dropping the data in the webconfig file.

    So my initial question is:
    1)where in the web.config file would I put this?

    But I also wonder if this is the best way to store the data. I know I could store it in a database, but that seems excessive. I also am pretty sure I could store the data in an XML, but I am not sure how to save and retrieve data from an XML file.

    The data I am wanting to store is a simple text description and a URL.

  2. #2
    SitePoint Guru pufa's Avatar
    Join Date
    Oct 2004
    Location
    Portugal, Lisboa
    Posts
    947
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    web.config is not the place to store updatable data. Put it in another file.

    Changes to the web.config cause app restarts.
    Ciao, Rui...

  3. #3
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,880
    Mentioned
    48 Post(s)
    Tagged
    0 Thread(s)
    Databases are a lot more optimized for performance. So it is def not an overkill for a database. Xml file you can use XmlReader and XmlDocument or XDocument. There are a lots of different ways to interact with XML files. Google ca help you here

  4. #4
    SitePoint Zealot
    Join Date
    Oct 2009
    Location
    Oklahoma, USA
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, I will look into the xml. Thanks for the help


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •