xml help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi

i have 2 texboxes on my vb.net form. i need to save the data into xml file
and read the data from xml file. can anyone give me a link for sample code.

My xml file data format:
<?xml version="1.0" ?>
<?xml-stylesheet type='text/xml'?>
- <Data>
<Name>test</Name>
<Agel>12</Age>
</Data>

thanks
bala
 
Bala,

Written in this message so can have errors or typos
\\\
Private ds as dataset
///
\\\
Button1 event
ds.readXML("mydatasetpath)
textbox1.DataBindings.Add(New Binding("Text", ds.Tables(0), "CompleteName"))
textbox2.DataBindings.Add(New Binding("Text", ds.Tables(0), "Age"))
///
\\\
Button2 event
BindingContext(ds.Tables(0)).EndCurrentEdit()
ds.writeXML("myexportpath")
///

It is better not to use "Name" as keyword because that can bring you in
problems when you start using SQL.

It will be good using things as file.exist and file.move to create
intermidiate files between the writting because otherwise when there is an
error everything will be gone.

I hope this helps?

Cor.
 
Thanks!
i folllowed this code.

Dim XMLDoc As Xml.XmlDocument = New Xml.XmlDocument
XMLDoc.Load(aPath)
MsgBox(XMLDoc.SelectSingleNode("PatientData/ML_First").InnerText)

-Bala
 
Back
Top