将xmldatasource转换为datatable。 [英] Convert xmldatasource to datatable.
本文介绍了将xmldatasource转换为datatable。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用xml文件。我正在尝试将xmldatasource转换为datatable.But我不知道该怎么做。任何人都可以帮助我吗?
这是样本xml文件
< survey>
< survey id =1desc =data>
< survey id =2desc =dddd>
Hi,
I am working with the xml files.I am trying to convert the xmldatasource to datatable.But I don't know how to do that.Can anyone help me?
This is the sample xml file
<surveys>
<survey id="1" desc="data">
<survey id="2" desc="dddd">
推荐答案
这应该有帮助,
http://stackoverflow.com/questions/6228315/convert-xml-to-datatable [ ^ ]
This should help,
http://stackoverflow.com/questions/6228315/convert-xml-to-datatable[^]
Hello!
我也有这个问题。我找到了解决方案。
Hello!
I had this issue too. And I've found solution.
DataTable dt = new DataTable();
DataSet ds = new DataSet();
ds.ReadXml(new XmlNodeReader(xmlDS.GetXmlDocument())); // xmlDS - XmlDataSource
dt = ds.Tables[0];
请参阅,
http://csharp.net-informations.com/xml/read-xml-to-dataset.htm [ ^ ]
这篇关于将xmldatasource转换为datatable。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文