Xml To Access

Joined
Nov 7, 2008
Messages
20
Programming Experience
Beginner
I want to migrate the data from xml to access database
I have used following code to retrieve information from xml file

VB.NET:
 Dim reader As New XmlTextReader("sample.xml")
        While reader.Read()
        listbox1.items.add(reader.Value)
        End While

This code display the data from xml file to listbox. But I want to write data from xml file to access database . Hence Please help me to migrate my xml data to access database. thanks in advance
 
You can read the xml file directly into a dataset. You can then insert the dataset records into your database.
 
VB.NET:
Dim ds As New DataSet
ds.ReadXml("C:\Temp\Sample.xml", XmlReadMode.Auto)

If you've got schema information in your file you can change the read mode from Auto to, ReadSchema.

There's a ton of threads in the MS Access section on transferring data from a dataset to an Access db.
 
Back
Top