Is it possible to read in an xml string and use the attributes for column naming?
For example using the following xml.
<root>
<CategoryInfo>
<column name="Category Name" value="1. In agreement" />
<column name="Category ID" value="1" />
</CategoryInfo>
<CategoryInfo>
<column name="Category Name" value="2. Small conflict" />
<column name="Category ID" value="2" />
</CategoryInfo>
<CategoryInfo>
<column name="Category Name" value="3. Strongly Disagree" />
<column name="Category ID" value="3" />
</CategoryInfo>
<CategoryInfo>
<column name="Category Name" value="4. Mark For CommitteeReview" />
<column name="Category ID" value="4" />
</CategoryInfo>
I would like to use
Dim ds As New DataSet()
Dim stream As New IO.StringReader(xmlData.ToString)
ds.ReadXml(stream)
Dim dt As DataTable = ds.Tables(0)
To convert it to a datatable, but the attributes mess it all up.
Thanks for any help.
This loops through and adds each attribute as a column name. Not sure if its along the lines for what you’re looking for but it gives you another option.