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

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

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!!!!!

For Dim Value As String = My.Settings.Astrology

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.