I have a dataset which I am populating via an Oracle SQL query:
SELECT col_id, col_desc
FROM table_data;
Then I generate the dataset, via the function
Dim ds as New DataSet
OracleDataAdapter.Fill(ds)
Now, when I get the XML of the generated dataset via:
Dim strXML as String
strXML = ds.GetXML()
When I read/display the string, it is showing as follows:
<NewDataSet>
<Table>
<COL_ID>ABC001</COL_ID>
<COL_DESC>Angelo</COL_DESC>
</Table>
<Table>
<COL_ID>ZFE851</COL_ID>
<COL_DESC>John</COL_DESC>
</Table>
<Table>
<COL_ID>XYU123</COL_ID>
<COL_DESC>Mary</COL_DESC>
</Table>
<Table>
<COL_ID>MLP874</COL_ID>
<COL_DESC>James</COL_DESC>
</Table>
</NewDataSet>
What I want is that the resulting string should rather display as follows:
<NewDataSet>
<Table COL_ID="ABC001" COL_DESC="Angelo"></Table>
<Table COL_ID="ZFE851" COL_DESC="John"></Table>
<Table COL_ID="XYU123" COL_DESC="Mary"></Table>
<Table COL_ID="MLP874" COL_DESC="James"></Table>
</NewDataSet>
How would I be able to accomplish this?
Would it be easy if say, I would read the rows from the table in the dataset and construct the string?
Your inputs would be highly appreciated. Thanks.