How to get DataType specific DataTable from XML
This is my code
string XMLReportFormat =@"<?xml version="1.0" encoding="utf-8" ?>
<Table>
<ReportBody>
<TableRow>
<ID>1</ID>
<ParentID>1</ParentID>
<Key>First1</Key>
</TableRow>
<TableRow>
<ID>4</ID>
<ParentID>1</ParentID>
<Key>FirstChild4</Key>
</TableRow>
</ReportBody>
</Table>";
StringReader sReader = new StringReader(XMLReportFormat);
DataSet ds = new DataSet();
if (sReader == null)
return null;
ds.ReadXml(sReader);
Here I am getting all DataType of columns as String.
I want some columns like ID and ParentID as Integer
Yeah ! I found the answer.
This line helps me 🙂