Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From here: <a href="http://www.dreamincode.net/code/snippet3186.htm">http://www.dreamincode.net/code/snippet3186.htm</a></p> <pre><code>// &lt;summary&gt; /// method for reading an XML file into a DataTable /// &lt;/summary&gt; /// &lt;param name="file"&gt;name (and path) of the XML file&lt;/param&gt; /// &lt;returns&gt;&lt;/returns&gt; public DataTable ReadXML(string file) { //create the DataTable that will hold the data DataTable table = new DataTable("XmlData"); try { //open the file using a Stream using(Stream stream = new FileStream(file, FileMode.Open, FileAccess.Read)) { //create the table with the appropriate column names table.Columns.Add("Name", typeof(string)); table.Columns.Add("Power", typeof(int)); table.Columns.Add("Location", typeof(string)); //use ReadXml to read the XML stream table.ReadXml(stream); //return the results return table; } } catch (Exception ex) { return table; } } </code></pre> <p>You might want to take a look at <a href="http://msdn.microsoft.com/en-us/library/fs0z9zxd.aspx">DataTable.ReadXml</a> method.</p> <p>EDIT: If you have xml object in memory you can use the ReadXml method directly. <code>DataTable.ReadXml(MemoryStream Object);</code></p> <p>EDIT 2: I did the export. The following XML Schema is required:</p> <pre><code>&lt;?xml version="1.0" standalone="yes"?&gt; &lt;DocumentElement&gt; &lt;symbols&gt; &lt;symbol&gt;EURCHF&lt;/symbol&gt; &lt;/symbols&gt; &lt;symbols&gt; &lt;symbol&gt;EURGBP&lt;/symbol&gt; &lt;/symbols&gt; &lt;symbols&gt; &lt;symbol&gt;EURJPY&lt;/symbol&gt; &lt;/symbols&gt; &lt;/DocumentElement&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload