如何添加XML放在数据表中 [英] How to add xml out put in Datatable
本文介绍了如何添加XML放在数据表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
按照主题行,
我想将我的xml添加到datatable中.
请对此提供帮助/建议.
-
YRishi
Dear All,
As per subject line,
I want to add my xml out put in datatable.
Please help/suggest me on this.
-
YRishi
推荐答案
添加"是什么意思.您想使用XML作为数据源吗?将XML转换为对象集合可能更有意义吗? XML并不总是符合有助于在表中显示的格式. LINQ可以在一行代码中将XML转换为对象集合.
What do you mean by ''add''. You wnat to use XML as a data source ? Might it not make more sense to turn your XML in to a collection of objects ? XML does not always conform to a format that''s conducive to showing in a table. LINQ can turn your XML in to a collection of objects in one line of code.
我不清楚吗?我想你要这个.
dt.ReadXml(MapPath("filename.xml"));
It''s not clear to me? I think you want this.
dt.ReadXml(MapPath("filename.xml"));
这篇关于如何添加XML放在数据表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文