title: C# compare two Lists and update it's column values
body: <p>I've got two C# lists (List listA and List listB) 
  how can I compare these two and if duplicate (of specific columns ex. ID_num and ID_cust) is found then update column "ID_duplicate" which is value of listB's columns ID. </p>
  
  <pre><code>DataSet ds =  subMain;
  
  List&lt;string&gt; listA = (from r in ds.Tables[0].AsEnumerable()
                        Select r.Field&lt;string&gt;("ID_num") + 
                         r.Field&lt;string&gt;("ID_cust")).ToList();
  
  DataSet dsMain = Mains;
  
  List&lt;string&gt; listB = (from r in dsMain.Tables[0].AsEnumerable()
                        select r.Field&lt;string&gt;("ID_num") + 
                        r.Field&lt;string&gt;("ID_cust")).ToList();
  </code></pre>
  
  <p>I want that <code>listA</code> will contain new column <code>ID_duplicate</code> with value <code>ID_num</code> from <code>listB</code>.</p>
  
  <p>So that duplicates will be somehow linked with this <code>ID_num</code>. </p>
  
  <p>I will then update that <code>ID_duplicate</code> to database.  </p>
  
  <p>Edit: 
  Added more explanation in comment bellow. </p>