数据集到数据表 [英] Dataset to datatable
问题描述
我想将xml读入数据表。
虽然,我似乎只能将其读入数据集。
我想得到与我在Excel中打开xml时的结果相同。
但是我只能在DataSet中打开xml,因为它想要创建更多的表。是否可以将我的XML读入一个数据表?
或者是否可以将包含多个父/子数据表的数据集复制到一个大数据表中?
这意味着父数据将出现在所有子数据行中。
例如
I want to read an xml into a datatable.
Though, I seem to be only able to read it into a DataSet.
I would like to get the same result as when I open the xml in Excel.
But instead I am only able to open the xml in a DataSet as it wants to make more tables. Is it possible to read my XML into one datatable?
Or would it be possible to copy a dataset containing multiple parent/child datatables into one large datatable?
This means that parent data would occur in all child data rows.
e.g.
<school>
<schoolID>HighSchool</schoolID>
<students>
<Name>Mark</Name>
<Name>Jane</Name>
</students>
</school>
这将导致多个数据表,但我希望将所有数据放入一个数据表中。 (在我的特定文件中,当我将xml读取到数据集时,我得到9个数据表)
This would lead to multiple datatables, but I would like to have all data into one datatable. (in my specific file I get 9 datatables when I read the xml to a dataset)
推荐答案
DataTable.Merge方法 [ ^ ]?
这篇关于数据集到数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!