Click here to Skip to main content
12,239,778 members (66,002 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
Hi,

I am working with the xml files.I am trying to convert the xmldatasource to datatable.But I don't know how to do that.Can anyone help me?

This is the sample xml file





Posted 13-Dec-12 5:37am
Edited 13-Dec-12 7:17am
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
priya9826 13-Dec-12 12:02pm
   
This is the xml file which contains data like below::









How can I convert this in to datatable?

How to convert this
priya9826 13-Dec-12 12:03pm
   


jibesh 13-Dec-12 12:42pm
   
dont see anything xml data in your post.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hello!
I had this issue too. And I've found solution.
DataTable dt = new DataTable();
DataSet ds = new DataSet();
ds.ReadXml(new XmlNodeReader(xmlDS.GetXmlDocument())); // xmlDS - XmlDataSource
dt = ds.Tables[0];
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 19 Mar 2015
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100