User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 456,558 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,461 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 3406 | Replies: 3 | Solved
Reply
Join Date: Aug 2007
Posts: 63
Reputation: bcm is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
bcm's Avatar
bcm bcm is offline Offline
Junior Poster in Training

reading and inserting in xml child nodes

  #1  
Oct 25th, 2007
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
BCM
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: England
Posts: 156
Reputation: ptaylor965 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: reading and inserting in xml child nodes

  #2  
Oct 25th, 2007
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
Last edited by ptaylor965 : Oct 25th, 2007 at 9:38 pm.
Peter Taylor
Visual Basic.NET Application Developer

TaylorsNet
http://www.taylorsnet.co.uk
Reply With Quote  
Join Date: Aug 2007
Posts: 63
Reputation: bcm is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
bcm's Avatar
bcm bcm is offline Offline
Junior Poster in Training

Help Re: reading and inserting in xml child nodes

  #3  
Oct 26th, 2007
Originally Posted by ptaylor965 View Post
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!!!!!
BCM
Reply With Quote  
Join Date: Oct 2006
Location: England
Posts: 156
Reputation: ptaylor965 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: reading and inserting in xml child nodes

  #4  
Oct 26th, 2007
For Dim Value As String = My.Settings.Astrology

The setting must by in setup in the Settings Tab of "My Project" area
Peter Taylor
Visual Basic.NET Application Developer

TaylorsNet
http://www.taylorsnet.co.uk
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 5:37 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC