0

I have created child nodes in app.config.xml file:
<applicationSettings>
<XML.My.MySettings>
<setting name="Astrology" serializeAs="String">
<value></value>
</setting>
<setting name="Cricket" serializeAs="String">
<value></value>
</setting>
<setting name="ForiegnCurrency" serializeAs="String">
<value></value>
</setting>
<setting name="Jobs" serializeAs="String">
<value></value>
</setting>
</XML.My.MySettings>
</applicationSettings>

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

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by ptaylor965
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

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

I tried it but it gave me error on
Dim Value as StringValue = 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!!!!!

0

For Dim Value As String = My.Settings.Astrology

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.