title: Use LINQ to group data from DataTable
body: <p>I want to use LINQ to group data from a DataTable (columns: userid, chargetag, charge).</p>
  
  <p>The content could look like this:</p>
  
  <pre><code>userid    chargetag    charge
  -----------------------------
  user1     tag3         100
  user2     tag3         100
  user3     tag5         250
  </code></pre>
  
  <p>I need something like this as a result:</p>
  
  <pre><code>chargetag    count    sum
  -------------------------
  tag3         2        200
  tag5         1        250
  </code></pre>
  
  <p>This is what I have so far:</p>
  
  <pre><code>var groupedData = from b in dataTable.AsEnumerable()
                    group b by b.Field&lt;string&gt;("chargetag") into g
                    let count = g.Count()
                    select new
                    {
                        ChargeTag = g.Key,
                        Count = count,
                    };
  </code></pre>
  
  <p>I can extract the name of the chargetag and the number of it.
  How would I have to change the LINQ query to access the sum of charges as well?</p>
  
  <p>Thanks in advance :-)</p>
  
  <p>Regards,
  Kevin</p>