title: Using linq to group, select, and order a datatable
body: <p>I want to use Linq to select and group DataTable rows... and I want to order those in a descending manner by the "Max" created date in each group... are there any improvements that could be made to this code, in particular can I make the OrderByDescending part of the Linq, for example using:</p>
  
  <pre><code>                    orderby {... something here...} descending
  </code></pre>
  
  <p>--- current code ---</p>
  
  <pre><code>        DataTable dt = ReadDataTable();
          var rows = (from row in dt.AsEnumerable()
                      where row.Field&lt;bool&gt;("Active") == true
                      group row by new
                      {
                          CollectionId = row.Field&lt;int&gt;("CollectionId"),
                          CollectionName = row.Field&lt;string&gt;("CollectionName"),
                      } into grp
                      select new
                      {
                          CollectionId = grp.Key.CollectionId,
                          CollectionName = grp.Key.CollectionName,
                          MaxCreated = grp.Max(r =&gt; r.Field&lt;DateTime&gt;("Created"))
                      }).OrderByDescending(r =&gt; r.MaxCreated);
  </code></pre>