• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 844
  • Last Modified:

ConfigurationManager is Not Declared????

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???

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
        End Sub

Open in new window

1 Solution
Rahul Goel ITILSenior Consultant - DeloitteCommented:
You have to add "System.Configuration" as a reference and it will work.
SheritlwAuthor Commented:
Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now