0

如何返回以下匿名 linq 连接中的所有列:

var results = (from t in Table1.AsEnumerable() join t2 in Table2.AsEnumerable()
                on t.Field<string>("id") equals t2.Field<string>("id")
                into allcol from rows in allcol
                select rows);

我得到了允许的行Table2,并且没有来自的行Table1

4

1 回答 1

1
var results = (from t in Table1.AsEnumerable() 
                           join t2 in Table2.AsEnumerable()
                           on t.Field<string>("id")
                           equals t2.Field<string>("id")
                           into allcol
                           from rows in allcol
                           select new {table1=t,table2=rows});

我希望这将有所帮助。

于 2013-03-05T03:37:37.260 回答