如何在数据集中编写XML foreach数据行? [英] How to write xml foreach datarow in dataset?

查看:69
本文介绍了如何在数据集中编写XML foreach数据行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为数据集中的每个数据行编写xml?我在表中有5条记录的数据集,我想用5个xml文件写入xml文件.在一个xml文件中有一个记录.

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.

推荐答案

您可以执行许多方法,某些方法可能比其他方法更有效.

您可以为每个数据行创建临时数据表,并使用datatable.WriteXML()方法为每个数据行生成XML文件.
或者,您可以使用StreamWriter类为每一行手动创建XML.

选择是你的..

有了荣誉,

Pradeep
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


这篇关于如何在数据集中编写XML foreach数据行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆