以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  请教:如何将数据库中数据加载进xml架构?(C#)  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=69202)


--  作者:dhhdcl
--  发布时间:11/6/2008 3:41:00 PM

--  请教:如何将数据库中数据加载进xml架构?(C#)
我现在用的办法是
SqlDataAdapter da = new SqlDataAdapter(sql, connection);
DataTable dt = new DataTable();
DataSet ds = new DataSet();
ds.ReadXmlSchema("../../InfClass/SegmentRequirement.xsd");//读取架构文件
da.Fill(ds);                                               //填充dataset
str=ds.GetXml();

可是输出的结果是数据没有按照架构文件的格式输出,是不是数据和xsd不对应啊


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms