table schema to datatable c#
<p>How do I read a schema into datatable in c#</p>

<pre><code>&lt;header&gt;
  &lt;xs:schema id="header" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"&gt;
    &lt;xs:element name="header" msdata:IsDataSet="true" msdata:MainDataTable="Table" msdata:UseCurrentLocale="true"&gt;
      &lt;xs:complexType&gt;
        &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:element name="Table"&gt;
            &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                &lt;xs:element name="id" type="xs:int" minOccurs="0" /&gt;
                &lt;xs:element name="enteredon" type="xs:dateTime" minOccurs="0" /&gt;
                &lt;xs:element name="enteredby" type="xs:string" minOccurs="0" /&gt;
                &lt;xs:element name="remark" type="xs:string" minOccurs="0" /&gt;
              &lt;/xs:sequence&gt;
            &lt;/xs:complexType&gt;
          &lt;/xs:element&gt;
        &lt;/xs:choice&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
&lt;/header&gt;
</code></pre>

<p>Trying this code but fails:</p>

<pre><code> public static Stream StringToStream(string data)
 {
     try
     {
        System.IO.MemoryStream xmlStream = new System.IO.MemoryStream();
        StreamWriter writer = new StreamWriter(xmlStream);
        writer.Write(data);
        writer.Flush();
        return xmlStream;
     }
     catch (Exception)
     {
         return null;
     }
 }

table.ReadXmlSchema(StringToStream(saveData));
</code></pre>
