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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

705 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