Link to home
Start Free TrialLog in
Avatar of Sheritlw
SheritlwFlag for United States of America

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of Rahul Goel
Rahul Goel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sheritlw

ASKER

Thank you!