title: Linq query on DataTable
body: <p>I have a DataTable that is filled from a stored procedure. I am doing a query on the DataTable using a groupby so that I can implement a ListView within a ListView. (Matt Berseth - <a href="http://mattberseth.com/blog/2008/01/building_a_grouping_grid_with.html" rel="nofollow noreferrer">Building a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls</a>)</p>
  
  <p>My Query in my codebehind:</p>
  
  <pre><code>var query = from c in dtTaskOrder.AsEnumerable() 
          group c by c.Field&lt;string&gt;("CLIN") into g
          select new
          {
              Key = g.Key,
              Count = g.Count(),
              Items = g
          };
  
  listv.DataSource = query.ToList();
  listv.DataBind();
  </code></pre>
  
  <p>In my aspx file I am trying to Eval on the Items and the subsequent columns:</p>
  
  <p>
  
  <pre><code>&lt;asp:ListView ID="lv1" ... DataSource='&lt;%# Eval("Items") %&gt;'&gt;
  
     &lt;td&gt;&lt;%# Eval("SLIN") %&gt;&lt;/td&gt; // column name
     &lt;td&gt;&lt;%# Eval("ACRN") %&gt;&lt;/td&gt; // column name
     &lt;td&gt;&lt;%# Eval("Status") %&gt;&lt;/td&gt; // last column name
  </code></pre>
  
  <p>The HttpException was unhandled by user code - when it tries to Eval on the above column names.</p>
  
  <p>How can I formulate the above query so that "Items" is "Typed" and I can use the column names.</p>
  
  <p>Thanks for your help.</p>