我想加入两个表,它们有两个相同的列。我已经尝试过,但在新{}等于新{}时出错。C#使用Linq来加入2个表,并且有两个相同的列
我的代码:
var results = from table1 in table.AsEnumerable()
join table2 in comment.AsEnumerable()
//Comment
on new {table1.Field<string>("SignalName"), table1.Field<int?>("MessageID")}
equals new {table2.Field<string>("SignalName"), table2.Field<int?>("MessageID")}
into prodGroup
from table3 in prodGroup.DefaultIfEmpty()
select new
{
// something is there
};
非常感谢! –