title: Dataset ReadXML method Stream vs. String
body: <p>I have code that calls the ReadXml method of the DataSet class and passes in a file name ReadXml(strFileName).  Occasionally this throws a System.IO.IOException because the file is being used by another process.</p>
  
  <p>If I change the code to use the ReadXml(stream) method and pass in a FileStream like this:</p>
  
  <pre><code>using(FileStream fs = new FileStream(this.filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ))
  {
       MyDS.ReadXxml(FileStream);
  }
  </code></pre>
  
  <p>Will that prevent the IOException from occuring? What is going on under the hood when you simply pass in a file name?</p>