Proposed ChangeLog:
* DataRelation.cs: Added storage required to hold the relations.
Checking of constraints are not implemented yet. Extended properties and events
not ready yet.
* DataRelationCollection.cs: Implemented DataSetRelationCollection and
DataTableRelationCollection, both as inner class of the abstract class
DataRelationCollection (like Microsoft although not documented in ECMA).
* DataRow.cs: Implemented GetChildRows in a extremely slow way. Need to
implement caching like Microsoft later.
* DataSet.cs: Uncomment DataRelation related members. Uncomment code
for Nested XML. Implemented WriteTable(XmlWriter, DataRow[], XmlWriteMode) for
use of Nested XML. Fixed a wrong modifier in GetSerializationData.
* DataTable.cs: Uncomment DataRelation related members.
(btw, DataTableRelationCollection.cs is not even in the build list, so can
safely be removed)
With this patch, a person can:
- Add relations to DataSet and DataTable without error
- Find the relations by DataSet.Relations, DataTable.ChildRelations,
DataTable.ParentRelations
- Find related rows by DataRow.GetChildRows
- Directly use a Typed DataSet generated from MS XSD.exe without any
modification
- Generate Nested XML from a DataSet with DataRelation.Nested set
but not:
- Gurantee constraints are automatically created
- Find the constraints by DataTable.Constraints
- Find related rows by DataRow.GetParentRow, DataRow.GetParentRows
- Enforce unique constraint
- Enforce foreign key constraint
A sample Nested XML generated is like this:
<OEC>
<OE>
<OEID>23</OEID>
<Heading>JUPAS interview</Heading>
<SubHeading>for form 7 student</SubHeading>
<OESlot>
<OEID>23</OEID>
<OEItemNo>1</OEItemNo>
<VenueDesc>LG 103</VenueDesc>
</OESlot>
<OESlot>
<OEID>23</OEID>
<OEItemNo>2</OEItemNo>
<VenueDesc>LG 103</VenueDesc>
</OESlot>
</OE>
<OE>
<OEID>24</OEID>
<Heading>Psychology of Selling</Heading>
<SubHeading>The Important Things About Selling</SubHeading>
<OESlot>
<OEID>24</OEID>
<OEItemNo>1</OEItemNo>
<VenueDesc>Broadroom I, Grand Hyatt, Hong Kong
</VenueDesc>
</OESlot>
</OE>
</OEC>
Regards,
Alan
System.Data.diff
Description: Binary data
