Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Configuration settings problem
Message
 
To
18/01/2005 20:42:42
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
00978371
Message ID:
00978389
Views:
17
Thanks for your reply Michel, I've already tried that but didn't work!

I'm using the Imports keyword in the declaration section so I don't have to specify the Systems.Configuration path.

Enmanuel

>>I'm testing the configuration settings class with VB .Net and have the following configuration file
>>
>>
>><?xml version="1.0" encoding="utf-8" ?>
>><configuration>
>>  <AppSettings>
>>	<add key="Aplicacion" value="Application's Name" />
>>	<add key="ConnectionString" value="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CNT001;Data Source=ibm600e" />
>>  </AppSettings>
>></configuration>
>>
>>
>>
>>and I call the settings like this on my application's main sub
>>
>>
>>       Dim sAppName As String = ConfigurationSettings.AppSettings("Aplicacion")
>>        Dim sConnString As String = ConfigurationSettings.AppSettings("ConnectionString")
>>
>>
>>but I'm getting an error message: "Additional information: Unrecognized configuration section AppSettings"
>>
>>Can anybody tell me what am I doing wrong?
>
>This works ok for me. I added the Aplicacion key in my app.config file and did this:
>
>
>        Dim sAppName As String = System.Configuration.ConfigurationSettings.AppSettings("Aplicacion")
>        MessageBox.Show(sAppName)
>
>
>The name of the key was displayed ok.
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform