title: How to get non matched columns by comparing two datatables
body: <p>Hi all I am having two data tables as follows</p>
  
  <pre><code>DataTable dt1 = new DataTable();
  dt1.Columns.Add("ColumnId");
  dt1.Columns.Add("Column2");
  dt1.Columns.Add("Column3");
  dt1.Columns.Add("Column4");
  
  dt1.Rows.Add("1, "TestData", "TestData1", "TestData2");
  
  DataTable dt2 = new DataTable();
  dt2.Columns.Add("ColumnId");
  dt2.Columns.Add("Column2");
  dt2.Columns.Add("Column3");
  dt2.Columns.Add("Column4");
  
  dt2.Rows.Add("1, "TestData1", "TestData1", "TestData2");
  </code></pre>
  
  <p>I know how to get the non matched row by writing linq query as follows</p>
  
  <pre><code>var differences = dt1.AsEnumerable().Except(dt2.AsEnumerable(),DataRowComparer.Default);
  var v = differences.Any() ? differences.CopyToDataTable() : new DataTable();
  </code></pre>
  
  <p>But this is giving me entire row but what I need is only the non-matched columns with ColumnId like</p>
  
  <pre><code>ColumnnId    Column2
     1         TestData1 
  </code></pre>
  
  <p>One more point is my data can be changed in any of the columns, in that case I need to list out all the columns else the non matched columns. Also my column names can vary so I need the code in a dynamic way such that it should match with any column names specified</p>