Q:

How to copy values from one SQL Server table to equally named columns in another using LINQ

Sometimes in SQL Server we have a temporary import table ('Import') with lots of columns and another table ('Production') also with a lot of columns, and many columns have the same names (but not all), and we simply need to write the values of the equally named columns from one to the other (without processing them). Same database, equally named columns in both tables have the same types.
Usually we do it like this:
// Lots and lots of columns copied without processing
Production.ColumnA = Import.ColumnA; 
Production.ColumnB = Import.ColumnB;
Production.ColumnC = Import.ColumnC;
// [...]

// Some with processing
Production.ColumnQ1 = DoSomething(Import.ColumnQ2); 

That's annoying and somehow redundant if there are many columns. What would be the best way to copy those equally named columns automatically, like in this pseudo-code:
foreach(var importRow in ImportRows)
    foreach(Column col in Production.Columns)
        if(Import.Columns.Contains(col.Name)) newProductionRow[col] = importRow[col];

(Very similar to what one could do using DataTables with indices, but we don't want that here.)

A:

You can try using reflection to copy from one object to another, like described in this blog:  http://goneale.com/2009/02/16/cloning-object-properties-via-reflection/
If you have lot's of different types of tables you need to copy, you could add generics to the mix, so you only need to create one "copy" function.

