title: .NET 2.0 webservice not returning DataTable
body: <p>I have a webservice method defined as so:</p>
  
  <pre><code>[WebMethod]
  public DataTable GetResponseCodeTypes()
  {
    // connect to database and retrieve results,
    // then populate and return a DataTable
  }
  </code></pre>
  
  <p>The method has been verified via the webservice test form and returns a <code>DataTable</code> as expected:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;DataTable xmlns="http://tempuri.org/"&gt;
    &lt;DocumentElement xmlns=""&gt;
      &lt;ResponseCodeTypes&gt;
        &lt;CodeTypeId&gt;1&lt;/CodeTypeId&gt;
        &lt;Descrip&gt;RPC&lt;/Descrip&gt;
      &lt;/ResponseCodeTypes&gt;
      &lt;ResponseCodeTypes&gt;
        &lt;CodeTypeId&gt;2&lt;/CodeTypeId&gt;
        &lt;Descrip&gt;Non-RPC&lt;/Descrip&gt;
      &lt;/ResponseCodeTypes&gt;
      &lt;ResponseCodeTypes&gt;
        &lt;CodeTypeId&gt;3&lt;/CodeTypeId&gt;
        &lt;Descrip&gt;No connect&lt;/Descrip&gt;
      &lt;/ResponseCodeTypes&gt;
    &lt;/DocumentElement&gt;
  &lt;/DataTable&gt;
  </code></pre>
  
  <p>However, when I call the <code>GetResponseCodeTypes</code> method from my C# frontend code, not only does it return a <code>DataSet</code> instead of a <code>DataTable</code>, but the returned <code>DataSet</code> contains zero tables.</p>
  
  <p>I then went and modified the stub class (generated by Visual Studio when a web reference is added) to return a <code>DataTable</code> instead. This works, inasmuch as I do get a <code>DataTable</code> back - but said <code>DataTable</code> has no columns or rows defined.</p>
  
  <p>I know in .NET 1.x it was not possible to return a <code>DataTable</code> from a webservice method (you had to wrap it in a <code>DataSet</code>) but I was under the impression that this was fixed in .NET 2.x...</p>
  
  <p>What is the issue here?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The webservice is .NET 2.0, running on a Linux box under Mono 2.4.2.3; while the frontend code is being developed in .NET 2.0 on a Windows XP machine running VS2008 with SP1.</p>