title: Linq join 2 datatables that share a column and put result in new datatable
body: <p>I have the following datatables</p>
  
  <p><strong>table1</strong>:</p>
  
  <pre class="lang-none prettyprint-override"><code>+-----------+------+------+
  | catalogid | name | snum |
  +-----------+------+------+
  |       353 | xx   |    4 |
  |       364 | yy   |    3 |
  |       882 | zz   |    3 |
  |       224 | mm   |   71 |
  |       999 | kk   |  321 |
  |        74 | kk   |    4 |
  |        54 | ii   |    5 |
  |        11 | u    |    6 |
  |        23 | yy   |    6 |
  +-----------+------+------+
  </code></pre>
  
  <p><strong>table2</strong>:</p>
  
  <pre class="lang-none prettyprint-override"><code>+-----------+----------+--------------+
  | catalogid | numitems | ignoreditems |
  +-----------+----------+--------------+
  |       353 |        4 |            0 |
  |       364 |       10 |            0 |
  |       882 |        2 |            0 |
  |       224 |        0 |            7 |
  +-----------+----------+--------------+
  </code></pre>
  
  <p>Using LINQ I want to join them and copy the result to a new datatable. They both share <code>catalogid</code>, and in the result it should only display the records that their catalogid exist in table2</p>
  
  <p><strong>result</strong>:</p>
  
  <pre class="lang-none prettyprint-override"><code>+-----------+------+------+-----------+---------------+
  | catalogid | name | snum | numitems  | ignoreditems  |
  +-----------+------+------+-----------+---------------+
  |       353 | xx   |    4 |         4 |             0 |
  |       364 | yy   |    3 |        10 |             0 |
  |       882 | zz   |    3 |         2 |             0 |
  |       224 | mm   |   71 |         0 |             7 |
  +-----------+------+------+-----------+---------------+
  </code></pre>
  
  <p>Here is my attempt but it's not working:</p>
  
  <pre class="lang-vb prettyprint-override"><code> Dim query = From a In oresult.AsEnumerable
               Group Join b In products.AsEnumerable
               On a.Field(Of Integer)("catalogid") Equals b.Field(Of Integer)("catalogid")
               Into Group
   query.copytodatatable
  </code></pre>
  
  <p><code>CopyToDatatable</code> is not working, and I can't figure out why</p>