954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

reading and inserting in xml child nodes

I have created child nodes in app.config.xml file:
.My.MySettings>

I want to insert values in this child nodes
Astrology=6:00
Cricket=7:00
ForeignCurrency=8:00
Jobs=9:00

How to read and insert values in this xml child nodes?
in VB.NET2005

bcm
Junior Poster in Training
64 posts since Aug 2007
Reputation Points: 18
Solved Threads: 0
 

You can read from both user and application settings but you can only write (save) user settings

To Read:
Dim Value as StringValue = My.Settings.Astrology
Value = My.Settings.Cricket
Value = My.Settings.ForeignCurrency
Value = My.Settings.Jobs

To Write:
My.Settings.Astrology = "6:00"
My.Settings.Cricket = "7:00"
My.Settings.ForeignCurrency = "8:00"
My.Settings.Jobs = "9:00"

But for XMLs other than the Settings Config i would use Datatable.readXML and Datatable.WriteXML as datatables allow better data control

ptaylor965
Junior Poster
170 posts since Oct 2006
Reputation Points: 16
Solved Threads: 19
 

You can read from both user and application settings but you can only write (save) user settings To Read: Dim Value as StringValue = My.Settings.Astrology Value = My.Settings.Cricket Value = My.Settings.ForeignCurrency Value = My.Settings.Jobs

To Write: My.Settings.Astrology = "6:00" My.Settings.Cricket = "7:00" My.Settings.ForeignCurrency = "8:00" My.Settings.Jobs = "9:00"

But for XMLs other than the Settings Config i would use Datatable.readXML and Datatable.WriteXML as datatables allow better data control


I tried it but it gave me error on
Dim Value asStringValue = My.Settings.Astrology
so I made it
Dim Value As String = My.Settings.Astrology
But now it shows an error
Configuration system failed to initialize
Please help!!!!!

bcm
Junior Poster in Training
64 posts since Aug 2007
Reputation Points: 18
Solved Threads: 0
 

For Dim Value As String = My.Settings.Astrology

The setting must by in setup in the Settings Tab of "My Project" area

ptaylor965
Junior Poster
170 posts since Oct 2006
Reputation Points: 16
Solved Threads: 19
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You