Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Cannot read application settings

Reply
Thread Tools

Cannot read application settings

 
 
vvenk
Guest
Posts: n/a
 
      10-10-2006
Hello:

I've defined two application settings in my web.config file. But in the
following code :

Dim rootWebConfig1 As System.Configuration.Configuration
rootWebConfig1 =
System.Web.Configuration.WebConfigurationManager.O penWebConfiguration(Nothing)
If (rootWebConfig1.AppSettings.Settings.Count > 0) Then

sField1 = rootWebConfig1.AppSettings.Settings("field1")
sField2 = rootWebConfig1.AppSettings.Settings("field2")

End If

rootWebConfig1.AppSettings.Settings.Count always returns 0.

What am I doing wrong?

Venki

 
Reply With Quote
 
 
 
 
Slim
Guest
Posts: n/a
 
      10-10-2006

"vvenk" <> wrote in message
news:5BEE13DE-9821-4AD2-9B20-...
> Hello:
>
> I've defined two application settings in my web.config file. But in the
> following code :
>
> Dim rootWebConfig1 As System.Configuration.Configuration
> rootWebConfig1 =
> System.Web.Configuration.WebConfigurationManager.O penWebConfiguration(Nothing)
> If (rootWebConfig1.AppSettings.Settings.Count > 0) Then
>
> sField1 = rootWebConfig1.AppSettings.Settings("field1")
> sField2 = rootWebConfig1.AppSettings.Settings("field2")
>
> End If
>
> rootWebConfig1.AppSettings.Settings.Count always returns 0.
>
> What am I doing wrong?



posting to a asp group with a asp.net problem


>
> Venki
>



 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      10-10-2006
vvenk wrote:
>
> rootWebConfig1.AppSettings.Settings.Count always returns 0.
>
> What am I doing wrong?


For one, you are asking in a classic ASP forum. You might have better luck
in [microsoft.public.dotnet.framework.aspnet].



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Settings.settings file with settings for multiple regions donet programmer ASP .Net 3 11-20-2009 03:05 PM
Cannot Delete File: Cannot read from source file or disk dwåcôn Computer Support 7 09-14-2005 10:51 PM
asp.net application loosing application settings in IIS Venkat Chellam ASP .Net 0 10-28-2004 03:15 PM
Server cannot access application directory... The directory does not exist or is not accessible because of security settings. ASP .Net Security 1 05-21-2004 03:47 PM
'current custom error settings for application prevent details of application error from being viewed. ' Damian ASP .Net 3 12-30-2003 08:01 PM



Advertisments