DataSets and XML - The Simplistic Approach

by DNB 21. November 2010 22:24

One of the first ways I learned how to read xml data from external data sources was by using a DataSet’s ReadXML function. This function takes file path for an XML document and then converts it to a Dataset. This functionality is great when you need a simple way to process an XML document.  In addition the DataSet object also offers a simple way to save data in an xml format by using the WriteXML function. This function saves the current data in the DataSet to an XML file to be used later.

DataSet ds  = New DataSet();
String filePath = “http://www.yourdomain.com/someData.xml”;
String fileSavePath = “C:\Temp\Test.xml”
//Read file for this location
ds.readxml(filePath);
//Save file to this location
ds.writexml(fileSavePath);

I have used the ReadXML function before when consuming data from external Rss feeds to display on one of my sites.  It allows me to quickly pull in data from external sites with little to no processing.


Example site: MyCreditTech.com

Tags:

Data Sources

Comments (2) -

crypter
crypter United States
12/24/2010 7:35:10 PM #

Stored for later use. Helped me alot, appreciate the time you guys put it in.

Lashaun Rossel
Lashaun Rossel United States
12/25/2010 11:06:31 AM #

I totally read your distribute and which sort I can certainly say is that it is been a long time since I discovered an article that i completely read with out being bored to death, keep them coming.

Comments are closed

Most comments