Solved

I am trying to transform an aspx web page(VB.NET) so that it has a code behind. Why am I getting this error? Why is it asking me to declare ConfigurationSettings when it has already been declared?

Posted on 2004-10-19
1
170 Views
Last Modified: 2010-04-23
I am trying to transform an aspx web page(VB.NET) so that it has a code behind. I have done all the changes according to a book I am following but I cannot seem to get the following code to work.

Public Class CodeBehindDemo
Inherits System.Web.UI.Page

Public Shared ConnectString As String = _
    ConfigurationSettings.AppSettings("MyDataSource")

This code seems to work ok in VS.NET but when I try to run the same in DreamweaverMX it flags up the error; BC30451: Name 'ConfigurationSettings' is not declared.

for each sub-procedure I am connecting to the datasource using;  Dim cnn As String = (CodeBehindDemo.ConnectString)...which has been changed from (ConfigurationSettings.AppSettings("MyDataSource")) when it was originally mixed with the HTML.

Why am I getting this error? Why is it asking me to declare ConfigurationSettings when it has already been declared?

Your help would be greatly appreciated.
0
Comment
Question by:pgilfeather
[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
1 Comment
 
LVL 4

Accepted Solution

by:
vinhthuy_nguyen earned 500 total points
ID: 12366870
Hey buddy,
I think you should check in your application, there is an XML file : web.config, it's auto create if you use VS.NET to create your application.
Ad the <appSettings> tag is the place that store any key that you declare, and all the key can be access everywhere in your application with :ConfigurationSettings.AppSettings("your key here").
Just a thinking.


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

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

735 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