App.config file Help

G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top