Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.11/5 (2 votes)
See more:
I have an XML file. I want to convert this to a DataTable. How do I do this, please?


[edit]1) Big and useless chunk of XML file removed. 2) English improved.[/edit]
Posted
Updated 9-Oct-17 2:16am
v2

You need to edit this and remove the dump of xml (presumably in the hope that someone will just write some code for you).

What have you tried? How did that work out? What problems did you encounter?
 
Share this answer
 
v2
Google.
Wonderful site.
You type a question, it gives you answers.
For example, I tried "use XML with datatable c#" and the top site was titled "Loading a DataSet from XML" on MSDN! A quick look, and it tells you how to load a DataTable from an XML file! Try it - it's not difficult, all you have to do is type "www.google.com" in the address bar of your browser, and off you go. :doh:

Looking at this web page gives descriptions, instructions, and even code! Admittedly, it's in VB, but it's not exactly difficult to understand...
Look here[^].
 
Share this answer
 
Comments
Divas Gupta 9-Oct-17 7:43am    
he is asking about xml string not file...
OriginalGriff 9-Oct-17 7:50am    
Read the question again: "I have an XML file..."
Divas Gupta 9-Oct-17 8:09am    
Sorry, I saw heading of the question.. :-(
OriginalGriff 9-Oct-17 8:19am    
Do not post solutions to old questions: it looks a lot like "rep point farming" which will get you banned from this site in very short order. A seven year old question probably does not need a solution any more.
I deleted your answer to prevent the reports beginning...

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900