XML and relational data-inferred dataset ing from XML

Source: Internet
Author: User
How to export dataset ing from XML

This example illustrates how to create a dataset (Dataset) ing from XML data. In this example, the concept of reasoning can be used to make the actual structure of XML data the basis of the relational architecture. In this example, the relational structure of tables and columns is created to store data in a dataset that complies with the export architecture.

 

VB datasetmapxmldata. aspx

[Running example] | [View Source code]

To export the architecture from the XML data structure, the following exampleCodeDescribes how to use the inferschema of xmlreadmode to call dataset. readxml. If you do not specify an xmlreadmode, The readxml method derives an architecture when the dataset has no schema and the document does not include an inline schema.


// Infer the dataset schema from the XML data and load the XML data datadoc. dataset. readxml (New streamreader ("books. xml"), xmlreadmode. inferschema );
'Infer the dataset schema from the XML data and load the XML data datadoc. dataset. readxml (New streamreader ("books. xml"), xmlreadmode. inferschema)
C # VB  

This example uses the displaytables method to display the structure and content of a dataset, just like how to load a dataset using XML. The following output shows the table name, column name, and row content generated when the displaytables method uses the schema exported from the books. xml file.

Creating an xmldatadocument... content of tables... tablename = book --------- columns... title book_id price genre publicationdate isbnnumber of rows = 3 rows... the Autobiography of Benjamin Franklin 0 8.99 autobiography 1981 1-861003-11-0the Confidence Man 1 11.99 novel 1967 0-201-63361-2the gorgias 2 9.99 philosophy 1991 1-861001-57-6tablename = Hor ------- columns... first-name last-name book_idnumber of rows = 3 rows... benjamin Franklin 0 Herman Melville 1 Sidas Plato 2
Summary
    1. reasoning is a mechanism through which the structure of XML data becomes the basis of the relational architecture.
    2. the readxml method of the dataset uses the XML file provided in streamreader to generate a link ing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.