Solved

ConfigurationManager is Not Declared????

Posted on 2009-07-02
2
812 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
2 Comments
 
LVL 9

Accepted Solution

by:
Rahul Goel 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now