[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
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
Medium Priority
?
175 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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

649 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