Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How to write xml foreach datarow in dataset? I have dataset with 5 record in table, i want write to xml file with 5 xml file. in one xml file have one record.
Posted
Comments
Manas Bhardwaj 29-Jul-11 6:39am    
any effort?
surender.m 30-Jul-11 1:26am    
As far as i know Dataset will contain datatables, but you are asking about datarows in dataset.
Is it like you are having 5 datatables in a dataset?
If so you can just iterate through dataset.tables and then make use of datatable.writexml().

1 solution

There are so many ways you can do this, some may be more efficient than others.

You can create temporary data table for each data row and use the method datatable.WriteXML() to generate the XML file for each of them.
Or you can use StreamWriter classes to create the XML manually for each row.

Choice is yours..

With kudos,

Pradeep
 
Share this answer
 

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