Last post Feb 18, 2012 09:49 PM by jgangwisch
Feb 18, 2012 08:21 PM|Watermelon5|LINK
I am a beginning developer, and I have to populate an XML file from a database table programmatically from code behind. The database I am using is Access and the programming language is VB.Net, but I am open to suggestions in other formats as it's easy to
translate. I can export information without a schema, but I need it to be in the preset schema. Is it possible to achieve? Thank you so much in advance.
Feb 18, 2012 09:49 PM|jgangwisch|LINK
Here is some sample code for you to use:
' create a connection
Dim con As New OleDbConnection()
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Northwind.mdb"
' create a data adapter
Dim da As New OleDbDataAdapter("Select * from Customers", con)
' create a new dataset
Dim ds As New DataSet()
' fill dataset
' write dataset contents to an xml file by calling WriteXml method