Username: Save?
Password:
Home Forum Links Search Login Register*
    News: Welcome to the TechnoWorldInc! Community!
Recent Updates
[November 08, 2024, 04:31:03 PM]

[November 08, 2024, 04:31:03 PM]

[November 08, 2024, 04:31:03 PM]

[November 08, 2024, 04:31:03 PM]

[November 08, 2024, 04:31:03 PM]

[October 17, 2024, 05:05:06 PM]

[October 17, 2024, 04:53:18 PM]

[October 17, 2024, 04:53:18 PM]

[October 17, 2024, 04:53:18 PM]

[October 17, 2024, 04:53:18 PM]

[September 09, 2024, 12:27:25 PM]

[September 09, 2024, 12:27:25 PM]

[September 09, 2024, 12:27:25 PM]
Subscriptions
Get Latest Tech Updates For Free!
Resources
   Travelikers
   Funistan
   PrettyGalz
   Techlap
   FreeThemes
   Videsta
   Glamistan
   BachatMela
   GlamGalz
   Techzug
   Vidsage
   Funzug
   WorldHostInc
   Funfani
   FilmyMama
   Uploaded.Tech
   MegaPixelShop
   Netens
   Funotic
   FreeJobsInc
   FilesPark
Participate in the fastest growing Technical Encyclopedia! This website is 100% Free. Please register or login using the login box above if you have already registered. You will need to be logged in to reply, make new topics and to access all the areas. Registration is free! Click Here To Register.
+ Techno World Inc - The Best Technical Encyclopedia Online! » Forum » THE TECHNO CLUB [ TECHNOWORLDINC.COM ] » Computer / Technical Issues » Hardware
  XML integration with ADO+
Pages: [1]   Go Down
  Print  
Author Topic: XML integration with ADO+  (Read 744 times)
Daniel Franklin
TWI Hero
**********


Karma: 3
Offline Offline

Posts: 16647


View Profile Email
XML integration with ADO+
« Posted: October 17, 2007, 10:36:47 AM »


One of the most important design goals for ADO+ was powerful XML support. Microsoft designed ADO+ hand in hand with the .NET XML framework. Both are components of a single architecture. The unification of ADO+ with the XML framework happens in the dataset.

For beginners datasets has methods that can read and write XML. For reading XML, the XML framework parser is used, either explicitly or implicitly. For writing XML out, the XML framework XmlWriter is utilized.

In spite of where the data originated, the dataset can save out its contents, both schema and data as XML. The schema is encoded as an internal W3C schema section, generally known as XSD, and the data is encoded as XML that be conventional to that schema. Because the dataset's native serialization format is XML, it is an tremendous medium for moving data between tiers in a disconnected fashion just like the disconnected recordset.

Indeed, .NET Web services make intense use of datasets to transport data in the context of a schema between tiers of an application. Just like populating the dataset via its object model or through managed providers, loading the dataset with XML is a two stage process.

1) The schema is created, and then the data is loaded. If the XML document comes with a schema, that schema is used to create the relational structure of the dataset. If not, the dataset can infer schema from the containment relationships within the document. In general speaking, elements that are not scalar valued are mapped to tables, whereas attributes and scalar valued elements are mapped to columns.

2) The process of inferring schema is useful when constructing an application that has to consume XML that comes with no schema. But for production applications, it is highly desirable to take the inferred schema, modify it as appropriate, and load that schema in before the actual data is loaded. That way, the process of loading the document is deterministic, so you don't have to worry about what a slight change in the incoming document will do to the inference heuristics.

Whatever the means for setting the dataset's schema, when it comes time to load XML into the dataset the following rules are used:

1) Elements with a certain name are mapped into the dataset of the same table name.

2) Attributes and scalar-valued sub-elements are mapped into columns of that table.

3) The schema of the table is expanded as appropriate if the columns are not already in the dataset or if the dataset does not already contain a table by the same name.

When loading an XML schema into the dataset, a table is created for each complex type in the schema, and containment is expressed using primary/foreign key relationships. The key columns are automatically inserted into the schema, and a Data relation is added for each pair of related tables.

Therefore, when loading data that resides in multiple tables from SQL server or any other database that supports XML, it is in some ways more expedient to use the XML loading facilities rather than the DataSet command. The former enables loading all the data in one step, whereas the latter requires a dataset command per table, and also involves setting up the relationships between the tables manually.

Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Copyright © 2006-2023 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.116 seconds with 24 queries.