I have a strongly typed dataset (generated from Visual Studio schema
designer) containing two related elements. In the resulting dataset class,
the DataRelation's Nested property is set to true. Reading a conforming XML
data document works fine, but when I create new child elements and write out
the full dataset, the new child elements are not nested in the parent.
For example, Staff and StaffMember are related by the DataRelation
relationStaff_StaffMember whose Nested property is true. After adding a new
StaffMember, "Lucas Gavitt", to the StaffDS dataset, the resulting file
looks like this:
<?xml version="1.0" standalone="yes"?>
<StaffDS xmlns="http://mydomain.com/StaffDS.xsd">
<Staff>
<StaffMember FirstName="Holli" LastName="Elliott">
<IsTeacher>true</IsTeacher>
<IsActive>true</IsActive>
</StaffMember>
<StaffMember FirstName="Kristin" LastName="Barker">
<IsTeacher>true</IsTeacher>
<IsActive>true</IsActive>
</StaffMember>
</Staff>
<StaffMember FirstName="Lucas" LastName="Gavitt">
<IsTeacher>true</IsTeacher>
<IsActive>true</IsActive>
</StaffMember>
</StaffDS>
Any reason why the Nested property would be ignored for the new element?
Thanks!
Kristin