title: Why does LINQ not work to add DataRows to a DataTable?
body: <p>To shoehorn ExpandoObjects into something grids like the following two attempts were made.</p>
  
  <p>This doesn't work:</p>
  
  <pre><code>var data = _d.Query&lt;dynamic&gt;(_script);         // returns IEnumerable&lt;ExpandoObject&gt;
  
  IDictionary&lt;string, object&gt; c = (IDictionary&lt;string, object&gt;)data.FirstOrDefault();
  DataTable dt = new DataTable();
  
  dt.BeginLoadData();
  dt.Columns.AddRange(c.Keys.Select(k =&gt; new DataColumn(k)).ToArray());
  data.Select(r =&gt; dt.Rows.Add((r as IDictionary&lt;string, object&gt;).Values.ToArray()));
  dt.EndLoadData();
  </code></pre>
  
  <p>But this does:</p>
  
  <pre><code>dt.Columns.AddRange(c.Keys.Select(k =&gt; new DataColumn(k)).ToArray());
  foreach (IDictionary&lt;string, object&gt; r in data)
    dt.Rows.Add(r.Values.ToArray());
  </code></pre>
  
  <p>Why?</p>