I've go the following XML file...
<A>
<B>
<C>ValueX</C>
<D>ValueY</D>
</B>
</A>
Which I read into a DataSet to display it in a DataGridView.
DataSet ds = new DataSet();
DataTable t = new DataTable("B");
ds.Tables.Add(t);
t.Columns.Add("C", typeof(string));
t.Columns.Add("D", typeof(string));
// bind to DataGridView
ds.ReadXml(file);
But when I write it back using the follwing command...
ds.WriteXml(file);
the nested structure of the file is destroyed.
<A>
<C>ValueX</C>
<D>ValueY</D>
</A>
Any ideas how to preserve the stcuture.