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
166 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
1 Comment
 
LVL 4

Accepted Solution

by:
vinhthuy_nguyen earned 500 total points
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
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.

771 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

15 Experts available now in Live!

Get 1:1 Help Now