title: XML DATASET to be Validated
body: <p>Hello all i have a scenario where i have</p>
  
  <p>TWO XML FILES</p>
  
  <p>one xml say "Books.xml" will create the schema for DATASET and i will use other XML file to load data into DATASET and all data in 2nd file will be inserted into DATASET </p>
  
  <p>I have done these things but i m stuck at validating XML i want to validate 2nd xml file 
  means data entered into dataset should be exactly valid according to DATASET schema which will be according to First XML</p>
  
  <p>i have tried it using XSD but i am not sure if XSD will be able to validate TYPE of data say if i have to input number and i have a string in my xml ,it should throw an exception</p>
  
  <p>i have my xml like this</p>
  
  <pre><code>&lt;DATA&gt;
    &lt;HISTORY&gt;
      &lt;book1&gt;SOmebook&lt;/book1&gt;
    &lt;/HISTORY&gt;
    &lt;POETRY&gt;
      &lt;book2&gt;Books&lt;/book2&gt;
    &lt;/POETRY&gt;
   &lt;/DATA&gt;
  </code></pre>
  
  <p>and i am generating my XSD Using VisualStudio </p>
  
  <p>to validate it im using a method something like this</p>
  
  <pre><code>XmlReaderSettings settings = //dont know exact settings
                 string data = null;
                 XmlReader Reader = XmlReader.Create(File.Open("C:\books.XML", FileMode.Open), settings, data);
  
              DataSet ds = new DataSet();
              ds.ReadXml(Reader); 
  </code></pre>