August 2003
Beginner to intermediate
600 pages
12h 57m
English
There are times when it is desirable to load or save only the schema portion of a DataSet. For example, you might have the rows of data ready to insert into a DataSet, but you want to make sure that your data conforms to a specific schema from someone else's DataSet. The other person can save their DataSet schema. Then you can take an empty DataSet, load the other person's schema, and then insert your own data. If your data violates the schema in some way, then an exception will be thrown as you enter it into the DataSet.
To load the schema from an XML representation of a DataSet and ignore any other data, call DataSet.ReadXmlSchema(). For example:
C# l_DataSet.ReadXmlSchema("\\XML_DataSet.xml"); VB l_DataSet.ReadXmlSchema("\XML_DataSet.xml") ...Read now
Unlock full access