Saving Form Data to XML

Lucretius

New member
Joined
Feb 12, 2009
Messages
4
Programming Experience
3-5
Hello all,

I have a form with a group of text/cbo boxes, and two listview controls. I would like to save these textboxes and listviews into a single xml doc with a schema like:

<MyDataFile>
<MyTextboxes>
<TxtBox1>Some Data</TxtBox1>
<TxtBox2>Some Data</TxtBox2>
</MyTextBoxes>
<MyListView1>
<Item1> 'repeat for all n items
<Col1>Some Data</Col1>
<Col2>Some Data</Col2>
</Item1>
</MyListView1>
<MyListView2>
<Item1> 'repeat for all n items
<Col1>Some Data</Col1>
<Col2>Some Data</Col2>
</Item1>
</MyListView2>
</MyDataFile>

I've figured out how to write each of the listview controls to separate xml files using a DataSet and the using the:
VB.NET:
DataSet.WriteXml("C:\MyListView.xml")
as explained here: Know Dot Net - Serializing a ListView to XML

and i think I can figure out how to do the text boxes, but how to I write them all into a single <MyDataFile> document root xml file? If some would give me some hints or a general algorithm to accomplish this it would be greatly appreciated, this is my first foray into vb.net & xml for that matter.

TIA
 
Im a little lost with your question but from what I can tell you are inputing your listview items to a table or tables within a dataset and that is correctly outputting an XML file for you.

If I understand the first part of your question correctly, you can add additional tables to your dataset, input your other info to those tables and then output everything as one XML file.
 
Back
Top