Solved

ConfigurationManager is Not Declared????

Posted on 2009-07-02
2
824 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

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

Suggested Solutions

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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