title: Filling a DataSet or a DataTable from a LINQ query result set
body: <p>How do you expose a LINQ query as an ASMX web service?
  <br>
  Usually, from the business tier, I can return a typed <code>DataSet</code> or a <code>DataTable</code> which can be serialized for transport over ASMX.</p>
  <p>How can I do the same for a LINQ query? <br>
  Is there a way to populate a typed <code>DataSet</code> or a <code>DataTable</code> via a LINQ query?</p>
  <pre><code>public static MyDataTable CallMySproc()
  {
      string conn = &quot;...&quot;;
  
      MyDatabaseDataContext db = new MyDatabaseDataContext(conn);
      MyDataTable dt = new MyDataTable();
  
      // execute a sproc via LINQ
      var query = from dr
                  in db.MySproc().AsEnumerable
                  select dr;
  
      // copy LINQ query resultset into a DataTable -this does not work !    
      dt = query.CopyToDataTable();
     
      return dt;
  }
  </code></pre>
  <p>How could I put the result set of a LINQ query into a <code>DataSet</code> or a <code>DataTable</code>?
  <br>
  Alternatively, can the LINQ query be serializable so that I can expose it as an ASMX web service?</p>