PC Review


Reply
Thread Tools Rate Thread

App.config file Help

 
 
=?Utf-8?B?TWFyYyBIYWxs?=
Guest
Posts: n/a
 
      31st Mar 2004
I have half of this figured out, but could use some help. I have created an xml app.config file. I have entered the Key/value pairs. no problem.

I am running in to a problem in retrieving the data. Here is the code I am attempting to use

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Loa
Public CompanyID as strin
Dim colAppSettings As System.Collections.Specialized.NameValueCollectio
Dim key As Strin
Tr
colAppSettings = Configuration.ConfigurationSettings.AppSettings(
Catch ex As Exceptio
MessageBox.Show(ex.Message
End Tr
Tr
CompanyId = colAppSettings("Companyid"
Catch ex As Exceptio
MessageBox.Show(ex.Message
End Tr

TextBox1.Text = CompanyI
End Su

I appears that the xml app.config file is read in correctly. but I cannot access any of the data in the collection

Thanks in advance for any and all help

Marc Hal

 
Reply With Quote
 
 
 
 
=?Utf-8?B?dE1hbg==?=
Guest
Posts: n/a
 
      31st Mar 2004
CompanyID=Configuration.ConfigurationSettings.AppSettings("Companyid").ToString(

----- Marc Hall wrote: ----

I have half of this figured out, but could use some help. I have created an xml app.config file. I have entered the Key/value pairs. no problem.

I am running in to a problem in retrieving the data. Here is the code I am attempting to use

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Loa
Public CompanyID as strin
Dim colAppSettings As System.Collections.Specialized.NameValueCollectio
Dim key As Strin
Tr
colAppSettings = Configuration.ConfigurationSettings.AppSettings(
Catch ex As Exceptio
MessageBox.Show(ex.Message
End Tr
Tr
CompanyId = colAppSettings("Companyid"
Catch ex As Exceptio
MessageBox.Show(ex.Message
End Tr

TextBox1.Text = CompanyI
End Su

I appears that the xml app.config file is read in correctly. but I cannot access any of the data in the collection

Thanks in advance for any and all help

Marc Hal

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Why this web config cannot reference an external config file? dh Microsoft C# .NET 0 2nd Oct 2009 12:12 AM
encrypting config file that aren't web config files... Ollie Riches Microsoft ASP .NET 1 4th Dec 2008 04:59 PM
Wiring up an App.Config file - deploying the App.Config file dbuchanan Microsoft Dot NET 12 27th Jul 2007 05:33 PM
sharedListeners config in app.config file doesn't recognize customlocation attribute RJ Microsoft Dot NET 0 1st Nov 2006 08:48 PM
using ReadXml to read exe.config file into Grid and update the exe.config using WriteXml hazz Microsoft C# .NET 0 7th Jul 2006 10:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:59 PM.