Working with the configurationmanager class

Discussion in 'MCTS' started by ChigbuaUmuenu, May 21, 2007.

  1. I am working on a windows application and want to read my connection string
    from my application configuration file.

    My code looks like:

    Dim myvalue As String =
    System.Configuration.ConfigurationManager.AppSetings("myConnectionString")

    However, Visual Studio 2005 underlines ConfigurationManager with a blue wavy
    line. When I point at it, it states that ConfigurationManager is not defined.

    Is there a reference I need to add to my application? I need help on how to
    read my settings from my App.config. I also do not want to use the obsolete
    ConfigurationSettings.AppSettings.

    I will be glad to get a clue to this problem.

    Thank you.
     
    ChigbuaUmuenu, May 21, 2007
    #1
    1. Advertisements

  2. Thanks to everybody who may have wanted to provide me solution.
    I discovered I was suppose to add reference to the System.Configuration dll

    I added the reference and it worked.

    I got this clue from MCTS Self - Paced Training Kit Exam 70-536. The writers
    did a mavelous job in the book. I am also happy with the stratification
    Microsoft has brought into the MCP Program.

    Obviously, a beginner will have a better understanding of the .NET Framework
    2.0 with 536. It will make him productive quickly.
     
    ChigbuaUmuenu, May 22, 2007
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.