Solved

ConfigurationManager is Not Declared????

Posted on 2009-07-02
2
826 Views
Last Modified: 2012-05-07
I have been trying to get my connectionstring from the web.config file and both methods I have tried give errors.
I have imported the System.Configuration but I keep getting ConfigurationManager not declared.
I also tried using ConfigurationSettings.appsettings and get this is obsolete.
What am I doing wrong???
Thanks


Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Configuration
Imports System.Data.Common
Imports System.Data.SqlClient
Imports System.Data.OleDb
Imports System.Data.Odbc
Imports System.IO
 
Namespace ApplicationFramework.DataAccessLayer
    Public NotInheritable Class DBManager
        Inherits DBManagerBase
        Public Sub OpenConnection()
 
            ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
          
          '  ConnectionString = ConfigurationSettings.AppSettings("ConnectionString").ToString
            MyBase.Open(ConnectionString)
        End Sub

Open in new window

0
Comment
Question by:Sheritlw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
Rahul Goel ITIL earned 500 total points
ID: 24769746
You have to add "System.Configuration" as a reference and it will work.
0
 

Author Closing Comment

by:Sheritlw
ID: 31599453
Thank you!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question