Read [for xml auto, elements] into DataTable in ADO.NET
- by ihorko
Hello All!
I have MS SQL Server stored procedure that returns XML (it uses SELECT with for xml auto, elements)
I tried read it into DataTable:
DataTable retTable = new DataTable();
SqlCommand comm = new SqlCommand("exec MySP", connection);
SqlDataAdapter da = new SqlDataAdapter(comm);
connection.Open();
da.Fill(retTable);
but retTable contains 12 rows with separated full xml thar SQL Server returns.
How can I read that XML from DB into DataTable object?
Thanks!