hitechboy78737
Programmer
I have an compact framework application that I would like to use XML files instead of a database to contain the applications data.
What I want to know is it possible to:
1. search the XML for a specific node... and grab the data like you would a recordset and a sql select command
2. write updates to that nodes data, again like you would with a recordset and sql update command
Say I want to find recordid 123456 from the following XML and change the name to John Doe:
I have read much over the last couple of days- and it's left me confused. As I understand it, the XMLReader is forward and read only. Is there a way to specifically find one thing without looping through the whole tree? How would you do that?
Secondly- I just do not understand how I can update that specific data. I even read that the XMLWriter is forward only too.
And lastly- how do you append new data to the end of an existing XML file? The example I looked at a few minutes ago just reproduced the ENTIRE data store and appended the new record to the end of that.
Can someone point me to an easily understandable reference(s) that cover this scenario I've described?
As usual, thanks for the advice and hand-holding!
Kevin Howell
Briefcase of Talent
What I want to know is it possible to:
1. search the XML for a specific node... and grab the data like you would a recordset and a sql select command
2. write updates to that nodes data, again like you would with a recordset and sql update command
Say I want to find recordid 123456 from the following XML and change the name to John Doe:
Code:
<records>
<record>
<recordID>123456</record>
<name>Sam Sneed</name>
</record>
<record>
<recordID>987654</recordID>
<name>Billy Ray</name>
</record>
</records>
I have read much over the last couple of days- and it's left me confused. As I understand it, the XMLReader is forward and read only. Is there a way to specifically find one thing without looping through the whole tree? How would you do that?
Secondly- I just do not understand how I can update that specific data. I even read that the XMLWriter is forward only too.
And lastly- how do you append new data to the end of an existing XML file? The example I looked at a few minutes ago just reproduced the ENTIRE data store and appended the new record to the end of that.
Can someone point me to an easily understandable reference(s) that cover this scenario I've described?
As usual, thanks for the advice and hand-holding!
Kevin Howell
Briefcase of Talent