title: How can I filter table and select rows which have parentid in id column
body: <p>My table has tow columns id, parentid and I want to filter data to select rows which have parentid ( as there can be rows without parentid row).</p>
  
  <pre>
  id parentid
  1  null
  2   1
  3   1
  4   2
  5   10
  </pre>
  
  <p>I want all the rows except 5, 10 as 10 is not there as a parent (no children unless parent is there).</p>
  
  <p>I want rows with parentid as I am using the data for treeview.
  I have tried couple of ways but not getting what I want.</p>
  
  <pre><code>var mycol = from t in ds.Tables[0].AsEnumerable()
      where t.Field&lt;int&gt;("Id") == t.Fields&lt;int&gt;("ParentId");
      select t;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>DataRow[] drs = ds.Tables[0].Select("ParentId in Id");
  </code></pre>