在Linq到Sql中的两个数据表之间执行完全外连接

时间:2013-09-21 09:19:44

标签: c# linq

我有两个名为dtPaymentsdtRecieptsNew的数据表,我需要在linq到sql中执行完全外连接。

我正在尝试:

var commonColumns = dtPayments.Columns.OfType<DataColumn>().Intersect( 
        dtRecieptsNew.Columns.OfType<DataColumn>(),
        new DataColumnComparer()
    );

DataTable result = new DataTable();
dtPayments.PrimaryKey = commonColumns.ToArray();

result.Merge(dtPayments, false, MissingSchemaAction.AddWithKey);
result.Merge(dtRecieptsNew, false, MissingSchemaAction.AddWithKey);

但是我收到了这个错误:The type or namespace name 'DataColumnComparer' could not be found (are you missing a using directive or an assereferrence

你可以提出任何想法吗?

感谢你。 Santosh Srinivas.g

0 个答案:

没有答案
相关问题