我有幾個EnumerableRowCollection包含許多列,我想在LINQ表達式中連接它們。 不幸的是他們沒有完全相同的列,但經常出現的列是已知的。如何使用LINQ連接不同的行集合?
簡化的情況:
Rows1 columns:
Col1 | Col2 | Col3
Rows2 columns:
Col1 | Col2 | Col4
Rows3 columns:
Col1 | Col2 | Col3 | Col5
Result columns:
Col1 | Col2 | [anything]
col1和col2的(這是在所有的行集合)是最重要的,其餘的甚至可以ommitted。
究竟是什麼你想實現什麼? – Vini
難道你只需從每個RowCollection中選擇col1&col 2,然後將結果添加到目標列表中,如果其他所有內容都不相關? – Marco