Users Pricing

forum

Home Forums How i can read xml into DataTable type object? – MindStick

How i can read xml into DataTable type object?

Jayden Bell 2211 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];

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md