Click here to Skip to main content
15,915,163 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

As per subject line,
I want to add my xml out put in datatable.
Please help/suggest me on this.

-
YRishi
Posted
Comments
Parwej Ahamad 1-Jul-11 5:47am    
I think your requirement is, fetch records from the XML out put and insert into Database.
If yes then search on Google first how to read XML file then you can easily insert record into Database OR you can do directly
Edit your question OR ask to them who created this requirement document.

What do you mean by 'add'. You wnat to use XML as a data source ? Might it not make more sense to turn your XML in to a collection of objects ? XML does not always conform to a format that's conducive to showing in a table. LINQ can turn your XML in to a collection of objects in one line of code.
 
Share this answer
 
v2
Comments
yrishi 1-Jul-11 5:35am    
Thanks for your reply.
I am reciving xml format output from webservice, I want to save this xml format output in datatable.
It's not clear to me? I think you want this.

dt.ReadXml(MapPath("filename.xml"));
 
Share this answer
 
v3
Comments
yrishi 1-Jul-11 5:38am    
thanks for your reply.
I am getting xml format out put from webservice. what i want to do is, I want to store this output in asp.net datatable and after that i want to store datatable into sqlserver db.
Please reply.
ParthaDinda 1-Jul-11 6:03am    
Then convert your xml to stream obj .
then read it as dt.readXml(streamread);
and after that insert it to db.

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