Link to home
Start Free TrialLog in
Avatar of maximjon
maximjon

asked on

vb.net write data to xml file

I am trying to write a vb.net program for a smart device, that writes the input from txt/combo boxes to an xml file. This file will be stored in the '/my documents/ data.txt' dir.  I plan to use active sync to push the data to the pc.  Here is what I have piced together so far,  the program creates the file, however does not populate with data.  I need to know what I should do next.

Dim t As New System.Data.DataTable
        With t.Columns
            .Add("eqnumber")
            .Add("OpStatus")
            .Add("keys")
            .Add("lights")
            .Add("glass")
        End With
        Dim r As System.Data.DataRow = t.NewRow
        r.Item("eqnumber") = Eq_Num.Text
        r.Item("opstatus") = ComboBox1.Text
        r.Item("keys") = ComboBox2.Text
        r.Item("lights") = ComboBox3.Text
        r.Item("glass") = ComboBox4.Text

        Dim ds As New System.Data.DataSet
        ds.tables.add(t)
        ds.writexml("\my documents\data.xml")

ASKER CERTIFIED SOLUTION
Avatar of toddhd
toddhd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial