title: datatable to datatable linq filter
body: <p>I am trying to take a main datatable, and pull a subset of data from it into another table. I cannot figure out how to get my LINQ syntax correct. </p>
  
  <pre><code>    static void Main(string[] args)
      {
  
          Console.WriteLine("start...");
  
          DataTable dt = new DataTable();
          dt.Columns.Add("fn", typeof(string));
          dt.Columns.Add("ln", typeof(string));
          dt.Columns.Add("EN", typeof(int));
          dt.Columns.Add("Role", typeof(string));
  
          Object[] rows = {
                               new Object[]{"Jane","Smith",123456,"Admin"},
                               new Object[]{"Jane","Smith",123456,"Test"},
                               new Object[]{"Jane","Smith",123456,"QA"},
                               new Object[]{"John","Doe",23456,"Admin"},
                               new Object[]{"John","Doe",23456,"Test"},
                               new Object[]{"John","Doe",23456,"Manager"},
                               new Object[]{"John","Doe",23456,"Approver"},
                               new Object[]{"Princess","Peach",12345,"Admin"},
                               new Object[]{"Princess","Peach",12345,"Test"},
                               new Object[]{"Princess","Peach",12345,"QA"}
                           };
  
          foreach(Object[] row in rows)
          {
              dt.Rows.Add(row);
          }
  
  
          DataTable o = dt.AsEnumerable()
              .Where(x =&gt; x.Field&lt;string&gt;("EN") == 123456)
              .CopyToDataTable();
  
          for(int i =0; i &lt;o.Rows.Count-1; ++i)
          {
              for(int x=0; x&lt;o.Columns.Count; ++x)
              {
                  Console.Write("{0}\t", o.Rows[i][x].ToString());
              }
              Console.WriteLine();
          }
  
  
          Console.WriteLine("fin...");
          Console.ReadLine();
  
      }
  </code></pre>
  
  <p>So what I would want in the resulting set would be records for Jane Smith. I also tried using </p>
  
  <pre><code>DataTable.Select("EN = 123456");
  </code></pre>
  
  <p>but that returns me a DataRow[] and I really want it to be in a table object. </p>