Using the Z application as an example, I am trying to figure out how to write a new entry in the tbl_Movies.xml via the dataset. However, everytime I try, it seems to be writing the new entry outside of the dataroot.
-----------------------------------------------------------------------------------
XML:
-----------------------------------------------------------------------------------
<root>
<dataroot>
<tbl_Movie>
...
</tbl_Movie> <--- Existing entries (all fine there)
...
...
...
</dataroot>
<tbl_Movie>
... <--- New entry (being written outside of dataroot)
</tbl_Movie>
</root>
-----------------------------------------------------------------------------------
C#:
-----------------------------------------------------------------------------------
DataTable table = dataset.Tables["tbl_Movies"];
DataRow row = table.NewRow();
row[".."] = ...;
row[".."] = ...;
...
table.Rows.Add(row);
table.AcceptChanges();
-----------------------------------------------------------------------------------
I have also tried table.Rows.InsertAt(row, 0); but either way the new entry is being written outside the dataroot.
How should I write this so that the new entry is written inside the dataroot?
Thanks in advance