IT Community - Software Programming, Web Development and Technical Support

Read XML by Dataset

This is a discussion on Read XML by Dataset within the ASP and ASP.NET Programming forums, part of the Web Development category; Hi, Here we have to read the XML by using Dataset, DataSet dataSet = new DataSet(); DataTable dataTable = new DataTable(); dataSet....


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 10-31-2007, 03:13 AM
gp_logesh gp_logesh is offline
D-Web Trainee
 
Join Date: May 2007
Posts: 29
gp_logesh is on a distinguished road
Cool Read XML by Dataset

Hi,

Here we have to read the XML by using Dataset,

DataSet dataSet = new DataSet();
DataTable dataTable = new DataTable();
dataSet.ReadXml(@"D:\XML\file.xml");
dataTable = dataSet.Tables["ITEMS"];
for (int i = 0; i < dataTable.Rows.Count; i++)
{
int noOfFields = dataTable.Rows[i].ItemArray.Length;
if (dataTable.Rows[i].ItemArray[noOfFields-7] + "" != "")
{
headerTab = dataTable.Rows[i].ItemArray[noOfFields - 6] + "";
subHeaderTab = dataTable.Rows[i].ItemArray[noOfFields - 5] + "";
break;
}
}


This is only applicable for the structured XML.
__________________
"GP_Logesh..."
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can we sort the values in dataset? mobilegeek C# Programming 4 04-18-2008 04:39 AM
how to update dataset to sql server? smani ASP and ASP.NET Programming 1 09-06-2007 07:29 AM
Can anybody explain about the differences between dataset.clone and dataset.copy? kingmaker C# Programming 2 08-28-2007 12:22 AM
Inconsistent accessibility error in the dataset Sathish Kumar C# Programming 1 08-22-2007 01:13 AM
Difference between ADO.NET dataset and ADO Record set? prasath ASP and ASP.NET Programming 1 07-18-2007 08:06 AM


All times are GMT -7. The time now is 07:22 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0