The first example shows a file name being passed to the Read Xml method. Finally, call End Load Data for each table in the Data Set, as shown in the following example.The second example shows a string that contains XML being loaded using a String Reader. Note If the XSD schema for your Data Set includes a target Namespace, data may not be read, and you may encounter exceptions, when calling Read Xml to load the Data Set with XML that contains elements with no qualifying namespace.For more information about Diff Grams, see Diff Grams.Continues reading multiple XML fragments until the end of the stream is reached.The Read Xml method reads from a file, a stream, or an Xml Reader, and takes as arguments the source of the XML plus an optional Xml Read Mode argument.(For more information about the Xml Reader, see NIB: Reading XML Data with Xml Text Reader.) The Read Xml method reads the contents of the XML stream or document and loads the Data Set with data.
See "Merging Data from XML" at the end of this topic.
It will also create the relational schema of the Data Set depending on the Xml Read Mode specified and whether or not a relational schema already exists.
The following table describes the options for the Xml Read Mode argument. Examines the XML and chooses the most appropriate option in the following order: - If the XML is a Diff Gram, Diff Gram is used.- If the Data Set contains a schema or the XML contains an inline schema, Read Schema is used.- If the Data Set does not contain a schema and the XML does not contain an inline schema, Infer Schema is used.
Dim data Set As Data Set = New Data Set Dim data Table As Data Table = New Data Table("table1") data Table. To read unqualified elements in this case, set element Form Default equal to "qualified" in your XSD schema.
For example: If the Data Set already contains data, the new data from the XML is added to the data already present in the Data Set.