forum

Home / DeveloperSection / Forums / How i can read xml into DataTable type object?

How i can read xml into DataTable type object?

Jayden Bell 1888 30-Jan-2014

I don't have problem if i read xml to DataSet:

DataSet temp = new DataSet();
temp.ReadXml(UncompressedStream, System.Data.XmlReadMode.Auto);

But if i use DataTable:

DataTable temp = new DataTable();
temp.ReadXml(UncompressedStream);
then datatable not load data (count of columns and rows equal 0 )

How i can read xml to DataTable

My temporary solution:

DataSet temp = new DataSet();
DataTable structure = new DataTable();
temp.ReadXml(UncompressedStream, System.Data.XmlReadMode.Auto);
structure = temp.Tables[0];

c# c# 
Updated on 30-Jan-2014

Can you answer this question?


Answer

1 Answers

Liked By