急!关于利用c# 读取sql2000数据库的数据为xml格式的文件 本帖最后由 twp104twp 于 2009-09-21 08:36:26 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 急!关于利用c# 读取sql2000数据库的数据为xml格式的文件 应该利用DATASET.WRITEXML方法,图片看不到 SQL77 (77C#+SQL) 我用的就是你说的那样,dataset.writexml但是不是给的图片的那种效果我把我的源代码发来看看 string sqlstr = " select data,discountno,discountname,productno,productname,quantity,price,pihao,unit,type ,accountno,accountname from tslmsyy for xml Auto "; //Query(sqlstr); //string yiyao = "XMLFile.xml"; SqlDataAdapter sda = new SqlDataAdapter(sqlstr, mydb.getcon()); DataSet ds = new DataSet(); sda.Fill(ds, "dstable"); //ds.ReadXml(Server.MapPath("./") + "XMLFile.xml"); //+ "/web.config"); string filepath = Server.MapPath("./xml/A.xml"); ds.WriteXml(filepath); DataTable tb = new DataTable(); DataView dv = new DataView(); tb = ds.Tables["dstable"]; dv = new DataView(tb); this.GridViewyy.DataSource = dv; //this .GridViewyy .DataBind (); gridviewread(); Response.Write("<script language='javascript'>alert('你已经成功生成了xml文件!')</script>");但是生成的xml格式文件的内容是如下的样子<?xml version="1.0" standalone="yes"?><NewDataSet> <dstable> <XML_F52E2B61-18A1-11d1-B105-00805F49916B><tslmsyy data="2009-07-07T00:00:00" discountno="p500108015x15ca" discountname=" 重庆九州通医药有限公司" productno="ccg039001g" productname="消渴丸" quantity="2" price="16" pihao="m01018" unit="瓶" type="批发" accountno="pdd3" accountname="重庆医药销售有限公司"/><tslmsyy data="2007-01-02T00:00:00" discountno="ppp520" discountname="重庆" productno="9001g" productname="渴丸" quantity="3" price="21" pihao="018" unit="瓶" type="批发" accountno="d3" accountname="重庆医药"/></XML_F52E2B61-18A1-11d1-B105-00805F49916B> </dstable></NewDataSet> 如何将html转为图片 WPF SelectedItemBinding怎么用啊 关于异步多线程的一个问题 关于C# 序列化json数据问题 C#源码下载 关于DataGrid和ViewState 关于using引用的简单问题. 新手求自动更新程序的问题 急! 有谁实现过ms的office commnicator 的聊天记录啊?? 怎么让进程在规定的时间停掉,如1s,2s后进程关闭. 急,求助c#多窗体调用 如何在自定义类的方法中控制form1对象的一个分量?
SQL77
(77C#+SQL) 我用的就是你说的那样,dataset.writexml但是不是给的图片的那种效果我把我的源代码发来看看 string sqlstr = " select data,discountno,discountname,productno,productname,quantity,price,pihao,unit,type ,accountno,accountname from tslmsyy for xml Auto "; //Query(sqlstr);
//string yiyao = "XMLFile.xml";
SqlDataAdapter sda = new SqlDataAdapter(sqlstr, mydb.getcon());
DataSet ds = new DataSet();
sda.Fill(ds, "dstable");
//ds.ReadXml(Server.MapPath("./") + "XMLFile.xml"); //+ "/web.config");
string filepath = Server.MapPath("./xml/A.xml");
ds.WriteXml(filepath); DataTable tb = new DataTable();
DataView dv = new DataView();
tb = ds.Tables["dstable"];
dv = new DataView(tb);
this.GridViewyy.DataSource = dv;
//this .GridViewyy .DataBind ();
gridviewread();
Response.Write("<script language='javascript'>alert('你已经成功生成了xml文件!')</script>");但是生成的xml格式文件的内容是如下的样子
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<dstable>
<XML_F52E2B61-18A1-11d1-B105-00805F49916B><tslmsyy data="2009-07-07T00:00:00" discountno="p500108015x15ca" discountname=" 重庆九州通医药有限公司" productno="ccg039001g" productname="消渴丸" quantity="2" price="16" pihao="m01018" unit="瓶" type="批发" accountno="pdd3" accountname="重庆医药销售有限公司"/><tslmsyy data="2007-01-02T00:00:00" discountno="ppp520" discountname="重庆" productno="9001g" productname="渴丸" quantity="3" price="21" pihao="018" unit="瓶" type="批发" accountno="d3" accountname="重庆医药"/></XML_F52E2B61-18A1-11d1-B105-00805F49916B>
</dstable>
</NewDataSet>