将数据库表中的数据转换为XML文件 [英] convert data in a database table into XML file

查看:321
本文介绍了将数据库表中的数据转换为XML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将数据库表中的所有数据转换为 XML 文件.
也就是说,我需要将表中的数据导出到XML文件中.

我正在使用Oracle作为数据库...

有人给我这样做的代码.或者给我任何想法...

谢谢和问候,
Kalai

解决方案

  string 文件名=   FileName";
System.IO.FileInfo fInfo =  FileInfo(路径+ "  \\" +文件名+  .xml");
   如果(dirInfo.Exists)
            {
                如果(fInfo1.Exists)
                    fInfo1.Delete();
            }
            其他
            {
                dirInfo =  DirectoryInfo(路径);
                dirInfo.Create();
            }


 dataSet.WriteXml(路径+ " ,XmlWriteMode.WriteSchema);  


I need to convert all the data in the database table into an XML file.
That is, I need to export the data in the table into an XML file.

Im using Oracle as my database...

Somebody give me the code for doing it. Or give me any ideas on it...

Thanks and Regards,
Kalai

解决方案

string Filename = "FileName";
System.IO.FileInfo fInfo = new FileInfo(path + "\\" + Filename + ".xml");
   if (dirInfo.Exists)
            {
                if (fInfo1.Exists)
                    fInfo1.Delete();
            }
            else
            {
                dirInfo = new DirectoryInfo(path);
                dirInfo.Create();
            }


 dataSet.WriteXml(path + "\\NewXml.xml", XmlWriteMode.WriteSchema);


这篇关于将数据库表中的数据转换为XML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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