home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / QuickStart / howto / doc / XML / XMLDataSet.aspx < prev    next >
Encoding:
Text File  |  2000-06-10  |  6.2 KB  |  106 lines

  1. <%@ Register TagPrefix="Acme" TagName="SourceRef" Src="/quickstart/util/SrcRef.aspx"%>
  2.  
  3. <!-- #include virtual="/quickstart/howto/doc/xml/header.inc" -->
  4.  
  5. <h4>How Do I...Use XML and the DataSet?</h4>
  6.  
  7. <div class="indent" style="width:660">
  8. These topics provide an introduction to the interaction between the DataSet and XMLDataDocument objects.</div>
  9.  
  10. <h4>XML and Relational Data. Same Data, Two Views.</h4>
  11. <div class="indent" style="width:660">
  12. XML often has a relational structure (the fictional books in a bookstore for example) as well as being unstructured.
  13. This set of topics cover the concept of storing
  14. this data centrally and providing different views on this data, either as XML or relationally as tables, columns and rows with relationships. This disconnected
  15. store of data which, for example, could represent a business object in the middle tier enforcing business rules, could serve
  16. its data up as XML to a browser via an XSL
  17. transform, across the internet to another site, or to a local application via the relational tables. However the data gets amended in the store, it can then be updated
  18. to a database transactionally. Also see <A target=content href="/quickstart/howto/doc/adoplus/adoplusoverview.aspx">How do I...Get an Overview of ADO+?</A></div>
  19.  
  20. <br clear="left"><div class="indent" style="width:660">
  21. A <b>DataSet </b>represents an in-memory cache of data which has a collection of tables and
  22. relationships between those tables. It is, in effect, a locally
  23. cached database. This provides a disconnected cache of data, like a message, that
  24. enables dealing with 'chunks' of data. The DataSet has no knowledge of where the
  25. data came from. It may have come from a file, a database connection or from a stream. DataSets provide a relational view onto this stored data.</div>
  26.  
  27. <br clear="left"><div class="indent" style="width:660">
  28. The <b>XmlDataDocument</b> provides XML APIs for accessing this in-memory cache of data as well as supporting reading and writing XML. The XmlDataDocument is a DataSet
  29. aware object. When creating an XmlDataDocument it implicitly creates a DataSet (accessed as a property)
  30. that provides a relational view onto the data XML data.
  31. This symbiotic relationship between the two objects provides a powerful technique for accessing data either relationally or as XML, irrespective of the mechanism
  32. by which the data was sourced.</div>
  33.  
  34. <h4>XmlDataDocument and DataSet Differences</h4>
  35.  
  36. <div class="indent" style="width:660">
  37. There are differences between these objects and their views. XML loaded via the <b>Load</b> method on the XmlDataDocument maintains full fidelity, which
  38. means that all the XML structure is maintained and can be accessed via the XML API. The <b>ReadXml</b> method on the DataSet however only
  39. loads the XML that conforms to the internally created mappings (schema). Whitespace and element ordering, as well as data that does not conform to the relational
  40. mapping is lost. Hence it does not retain XML fidelity. Also data which has been loaded via the XmlDataDocument and which does not conform to the internal
  41. mappings on the DataSet cannot be viewed via the relational API. Relational loaded data can always be viewed via the XML API.</div>
  42.  
  43. <br clear="left"><div class="indent" style="width:660">
  44. XML Data can be saved from both the DataSet with the <b>WriteXmlData</b> method and the XmlDataDocument with the <b>Save</b> method. The former saves a 
  45. normalized view of the relationally mapped data (i.e. The XML data that conforms to the internal
  46. schema, with elements ordered according to the relational schema), whilst the latter saves the XML with full
  47. fidelity (i.e. all the XML that has been loaded into the XmlDataDocument, including the preservation of whitespace and element ordering</span>).</div>
  48.  
  49. <h4>Topics</h4>
  50.  
  51. <div class="indent" style="width:660">
  52. Here we are going to work with XML data, DataSets and the XmlDataDocument to show this inter-change.</div>
  53.  
  54. <OL>
  55. <LI class="indent"> Firstly we are going to cover how a DataSet can build a relational view according to
  56. a supplied XSD schema in <A target=content href="DataSetMapXSDSchema.aspx">How do I...Create DataSet mappings from an XSD schema?</A> 
  57. <br clear="left"><br>
  58.  
  59. <LI>Then we cover how XML data gets loaded into the DataSet and accessed as relational data in
  60. <A target=content href="LoadDataSetXMLData.aspx">How do I...Load a DataSet with XML?</A> 
  61. <br clear="left"><br>
  62.  
  63. <LI>Next we cover how to infer a relational mapping from XML data, rather than an XSD schema in
  64. <A target=content href="DataSetMapXMLData.aspx">How do I...Infer DataSet mappings from XML?</A><br clear="left"><br>
  65.  
  66. <LI>Then we show how to save the infered schema generated from loaded XML data in
  67. <A target=content href="SaveDataSetMapXSDSchema.aspx">How do I...Save DataSet mappings to an XSD schema file?</A> 
  68. <br clear="left"><br>
  69.  
  70. <LI>And finally we cover how to access and save XML that has been loaded into the DataSet relationally in
  71. <A target=content href="SaveDataSetXML.aspx">How do I...Save a DataSet as XML?</A> </LI>
  72. <br clear="left"><br>
  73. </OL>
  74.  
  75. <h4>Related Topics</h4>
  76.  
  77. <div class="indent" style="width:660">
  78. Many features of the XmlDataDocument object utilizing the XML API have already been covered in the following preceding topics and these should be referred to in
  79. those scenarios whereby data is assessed as XML.
  80. </div>
  81.  
  82. <OL>
  83. <LI class="indent"><A target=content href="LoadXmlDocument.aspx">How do I...Load and use the XmlDataDocument?</A> 
  84. <br clear="left"><br>
  85. <LI><A target=content href="StreamAnXmlDocument.aspx">How do I...Read XML from an XmlDataDocument?</A> 
  86. <br clear="left"><br>
  87. <LI><A target=content href="NavigateXmlDocument.aspx">How do I...Navigate XML with the XmlNavigator?</A> 
  88. <br clear="left"><br>
  89. <LI><A target=content href="EditingXmlDocument.aspx">How do I...Edit XML with the XmlNavigator?</A> </LI>
  90. <br clear="left"><br>
  91. </OL>
  92.  
  93. <div class="indent" style="width:660">
  94. For coverage of the interaction between the DataSet and databases using managed providers see
  95. <A target=content href="/quickstart/howto/doc/adoplus/adoplusoverview.aspx">How do I...Get an Overview of ADO+?</A>
  96. </div>
  97.  
  98. <!-- #include virtual="/quickstart/howto/include/footer.inc" -->
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.