I have some XML in a string
in memory exactly like this:
EURCHF
EURGBP
I've been searching for a easy way to do the same for some time too, but never really found what I actually wanted. Here's one solution I came across. It works, but I don't really like it as I have to Read the File with a DataSet
and then put the create Table in the DataSet
into a DataTable
.
Anyway's, here's the code:
DataSet ds = new DataSet();
ds.ReadXml(path);
DataTable newDataTable = ds.Tables[0];
I also tried .ReadXml
for the DataTable
but it always threw an Exception.
I'm not happy with this solution, but it at least works.