Wednesday, November 30, 2022
Code Search
Code Bank
.NET Applications
XSD Schema Generator
.NET/XML Training


Moving YahooStores XML Data into a Database

The .NET framework provides several different mechanisms for moving XML data into a relational database. This sample shows how to take a real XML document (minus real names, addresses, and credit card numbers) generated from a YahooStores site and move it into existing SQL Server database tables.

Because the XML document does not match the database schema, it is transformed to fit the schema using XSLT and then read into a DataSet. The DataSet is first loaded with the database schema which is generated on the fly. SqlCommand objects are then dynamically created and associated with a SqlDataAdapter which inserts the DataSet data into three relational database tables.

Note: This is one of several solutions for moving complex hierarchical XML documents into relational database tables. Because this solution relies on XSLT it may perform poorly when extremely large XML documents need to be moved into a database due to the XML document being loaded into memory for the transformation.

Teaches ASP.NET, XML, Schemas, XSLT, System.Data
Requirements .NET 1.0
XML Document: Click Here
Example: Click Here
View Source Code: Click Here
Download Code: Click Here


.NET, SharePoint and Silverlight Training Solutions
    Online, Onsite and Video Training on .NET and SharePoint technologies available through The Wahlin Group.

© 2007 Wahlin Consulting LLC
XML for ASP.NET Developers in bookstores