title: How can I sum a field from a grandchild table in a LINQ to DataSet where clause?
body: <p>I think I need to do exactly this, but instead using LINQ to DataSets because the "Transactions" table is in DB2 and there is no data context.</p>
  
  <p><a href="https://stackoverflow.com/questions/1813285/linq-query-across-three-levels-of-tables-to-generate-sum">Linq query across three levels of tables to generate sum</a></p>
  
  <p>I setup two DataRelations on the DataSet:<br>
  1. relate Categories (ds.tables[0] in my example) to Products (ds.tables[1])<br>
  2. relate Products to Transactions (ds.tables[2])</p>
  
  <pre><code>var query = from x in ds.tables[0].AsEnumerable()
      orderby x.Field&lt;int&gt;("Priority")
      select new {
          Name = x.Field&lt;string&gt;("Text"),
          Amount = //maybe using GetChildRows here???
      };
  </code></pre>
  
  <p>I don't really know what to do about the amount. Thanks in advance!</p>