title: How can we copy the column data of one DataTable to another, even if there are different column names between DataTables?
body: <p>I have two DataTables. 
  First is</p>
  
  <pre><code>DataTable NameAddressPhones = new DataTable(); 
  </code></pre>
  
  <p>with Three columns <strong>Name, Address and PhoneNo</strong>.But I only want two columns <strong>Name and Address</strong> data so I want to copy those columns (with data) to the new DataTable.</p>
  
  <pre><code>DataTable NameAddress = new DataTable(); 
  </code></pre>
  
  <p>For that I do</p>
  
  <pre><code>            foreach (DataRow sourcerow in NameAddressPhones.Rows)
              {
                  DataRow destRow = NameAddress.NewRow();
                  foreach (string colname in columns)
                  {
                      destRow[colname] = sourcerow[colname];
                  }
                  NameAddress.Rows.Add(destRow);
              }
  </code></pre>
  
  <p>I clear the NameAddressPhones(first) DataTable every time there are new records inserted in the table. And every time there will be the same number of columns but the column names will be different like <strong>Nm</strong> instead of <strong>Name, Add</strong> instead of <strong>Address</strong>.Now the problem is the second DataTable already has column names <strong>Name and Address</strong> and now I want to copy the columns data of <strong>Nm and Add</strong> to the second DataTable but the column names are different than the column names of the second DataTable. So even if there are different column names I want to copy <strong>Nm</strong> column data of first DataTable to the column <strong>Name</strong> of second DataTable and column <strong>Add</strong> data of first DataTable to column <strong>Address</strong> of second DataTable.</p>
  
  <p>In short how can we copy column data from one DataTable to another even if there are different column names of both DataTables like <strong>Nm</strong> is the column name of first DataTable and <strong>Name</strong> is the column name of second DataTable then the data of the column <strong>Nm</strong> should be copied to the column <strong>Name</strong>.</p>