如何从数据库中保存c#中的XML文件 [英] How to save XML file in c# from database

查看:112
本文介绍了如何从数据库中保存c#中的XML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在sql server中创建了一个查询,将表转换为xml文件..

i想要保存文件,当我使用提交按钮时

i得到了查询as string



ex



sting xml =select convert(nvarchar,(convert(datetime,date) ,111)),11​​1)作为来自prg_detail的日期,其中id ='+ textbox1.text = ... +'FOR XML PATH(''),ROOT('EVENTSECTION');





这个




如何在notpad中保存文件

i have create a query in sql server which convert the table as xml file..
i want to save the file, when i use submit button
i got the query as string

ex

sting xml ="select convert(nvarchar,(convert(datetime,date,111)),111) as DATE from prg_detail where id= '"+textbox1.text=...+"' FOR XML PATH(''), ROOT('EVENTSECTION')";


this


how to save the file in a notpad

推荐答案

使用 StreamWriter [ ^ ]或 XmlWriter [ ^ ]。


这篇关于如何从数据库中保存c#中的XML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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