Creating One-to-Many Relationships in XML Schemas and Datasets
You create a schema with one-to-many relationships when XML files contain related elements that are hierarchically at the same level. For more information, see Tables, Columns, Keys, and Constraints in XML Schemas.
Tip If you have access to an XML file (.xml) that contains the structured data that your application needs to validate, see Creating XML Schemas from XML Files.
There are three main steps involved in creating an XML Schema that will be used to validate data that is structured in a one-to-many relationship.
To create a schema that represents a one-to-many relationship
- Create the tables that will represent your applications data structure.
- Create the primary keys, unique keys, and keyrefs.
- Create the relationships between the tables.
For instructions on See Constructing Tables Creating Tables in XML Schemas Defining Keys Creating Primary and Unique Keys in XML Schemas Defining Relationships (keyrefs) Creating DataRelation Objects with the XML Designer
Relational Data in XML Schemas | Tables, Columns, Keys, and Constraints in XML Schemas | Nested Relationships in XML | XML Schemas and Data | XML Schemas and the XML Designer | Creating XML Schemas and Datasets | XML Files | Introduction to Data Access with ADO.NET | Introduction to Datasets