Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: XML C#4.0 DataTable
Hai all,
 
How to convert a XMl File to DataTable using C#?
Posted 14-Jun-12 4:35am
P_A_1877
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
Espen Harlinn at 14-Jun-12 16:39pm
   
Good reply, and a nice set of links :-D
Sandeep Mewara at 15-Jun-12 2:55am
   
Thanks Espen. :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Add Reference:
 
Using System.Data;
 
Use :
 
DataSet ds = new DataSet();
ds.ReadXml("XmlFilePath");
DataTable dt = ds.Tables[0];
//or dt = ds.Tables["TableName"]
//or dt = ds.Tables[i] , i the index of the table in the xmlfile
  Permalink  
Comments
Pandvi at 14-Jun-12 23:39pm
   
Good work! my 5!
F. ARO at 14-Jun-12 23:44pm
   
welcome!
put your answer as solved if it is done.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

use method loadfromxml file to the dataset for this issue not datatable!and there is no problem
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

Hi
 
Check the below link it has the detailed code
 
Convert XML To Datatable in C#.net[^]
 
Thanks
  Permalink  
v2

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

  Print Answers RSS
0 Dnyaneshwar@Pune 604
1 OriginalGriff 394
2 thatraja 370
3 Sergey Alexandrovich Kryukov 329
4 CPallini 179
0 OriginalGriff 697
1 Dnyaneshwar@Pune 604
2 Kornfeld Eliyahu Peter 495
3 thatraja 370
4 Sergey Alexandrovich Kryukov 344


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 18 Feb 2014
Copyright © CodeProject, 1999-2014
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