title: How do I get list of id's as int using LINQ
body: <p>I have a DataTable, say pdt, in my code. I just want to select all <code>table["id"]</code> and populate then in an integer array.</p>
  
  <p>I can go ahead with a <code>foreach</code> but I am trying to learn Lambda expressions.
  I can't figure out how to deal with this.</p>
  
  <p>I have tried </p>
  
  <pre><code>List&lt;int&gt; Ids = pdt.Select(row =&gt; row["Id"]; return Convert.ToInt32(r));
  </code></pre>
  
  <p>and </p>
  
  <pre><code>int[] Ids = pdt.Select(row =&gt; row["Id"]);
  </code></pre>
  
  <p>but nothing seems to work. I am pretty sure this is a basic question, help out a newbie please.</p>