G
Graeme Richardson
Hi, I'm working without a database engine, and have created a relational
database using XML files.
I can load the data into a DataSet and then a DataTable with:
Dim ds As DataSet = New DataSet
ds.ReadXML("Program Files\Database\myFile.xml")
Dim dt As DataTable = ds.Tables("myTable")
I can add a new record with:
Dim dr As DataRow = dt.NewRow
dr("field1") = "New Value"
dt.Rows.Add(dr)
What I want to do now is write the changes back to 'myFile.xml'. I tried
dt.AcceptChanges()
ds.AcceptChanges()
but changes/additions aren't written to the file.
How can I get this to work?
Thanks, Graeme.
database using XML files.
I can load the data into a DataSet and then a DataTable with:
Dim ds As DataSet = New DataSet
ds.ReadXML("Program Files\Database\myFile.xml")
Dim dt As DataTable = ds.Tables("myTable")
I can add a new record with:
Dim dr As DataRow = dt.NewRow
dr("field1") = "New Value"
dt.Rows.Add(dr)
What I want to do now is write the changes back to 'myFile.xml'. I tried
dt.AcceptChanges()
ds.AcceptChanges()
but changes/additions aren't written to the file.
How can I get this to work?
Thanks, Graeme.