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.

    --
    Okoronkwo Chinedu
    Crazy About Learning
     
    ChigbuaUmuenu, May 21, 2007
    #1
    1. Advertising

  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.
    --
    Okoronkwo Chinedu
    Crazy About Learning


    "ChigbuaUmuenu" wrote:

    > 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.
    >
    > --
    > Okoronkwo Chinedu
    > Crazy About Learning
     
    ChigbuaUmuenu, May 22, 2007
    #2
    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. jonnah
    Replies:
    5
    Views:
    938
    Walter Roberson
    May 19, 2004
  2. Harkin
    Replies:
    0
    Views:
    524
    Harkin
    Jul 19, 2005
  3. Meat Plow

    Re: Class 5 vs. Class 6 Toilets

    Meat Plow, Aug 4, 2010, in forum: Computer Support
    Replies:
    0
    Views:
    676
    Meat Plow
    Aug 4, 2010
  4. tightfisted easy-pick-up

    Re: Class 5 vs. Class 6 Toilets

    tightfisted easy-pick-up, Aug 4, 2010, in forum: Computer Support
    Replies:
    4
    Views:
    1,820
    §ñühw¤£f
    Aug 5, 2010
  5. richard

    Re: Class 5 vs. Class 6 Toilets

    richard, Aug 4, 2010, in forum: Computer Support
    Replies:
    0
    Views:
    611
    richard
    Aug 4, 2010
Loading...

Share This Page