How to dynamically create schema for DataSet?

  • Thread starter Thread starter deko
  • Start date Start date
D

deko

I will be using the XmlDataDocument class to create a typed DataSet from an
XML file and an XSD file I've created that defines a few constraints and one
relationship. The initial data from the XML file looks like this (but this
is only a starting point):

<Projects>
<Project>
<ProjectName>DefaultProject</ProjectName>
<ProjectOption>false</ProjectOption>
</Project>
<Configuration>
<ConfigName>DefaultConfig</ConfigName>
<SourcePath>C:\some\path</SourcePath>
<ArchivePath>F:\some\other\path</ArchivePath>
</Configuration>
</Projects>

There is a one-to-many relationship between Project and Configuration - each
Project may contain many configurations, and ProjectOption is a boolean
value.

What happens when my code adds a new Project or Configuration? How do I
apply this same schema to the newly created data? Must I write code to add
the same schema over and over as new Projects and Configurations are
created?

Thanks in advance.
 
hi
if you InoforceSchema on your dataset, then that rule would be applied to
any new project added to your document.
 
Back
Top