0
我有TableA和TableB,其中TableA具有表B中引用的复合主键。复合列在字符串数组中可用。我怎样才能使用字符串数组中的列与表A的列匹配,从而动态地将TableA和TableB加载到数据集中。c#linq返回使用复合外键列的子表行
例如,
string[] arTableA = new string[]{Composite key columns of A};
string[] arTableB = new string[]{Composite key columns of B};
var Result = (from A in TableA)
join B in TableB on new {arTableA } equals new {arTableB}
select TableB.Columns
你说'DataSet' ,它真的是Linq-To-Objects的DataSet(在内存集合中)还是它是数据库提供者? –
[如何在单个连接中的多个字段上的LINQ中加入]可能的副本(https://stackoverflow.com/questions/373541/how-to-do-joins-in-linq-on-multiple-fields-in -single-join) – qxg
感谢您的快速回复。表格在数据集中,我正在迭代它。这些表格有数据,如订单和订单细节。根据某些规则,我必须删除一些顺序和级联效应orderdetails行。问题是我需要首先从两个表中找到唯一的列,然后基于这些列我必须从第二个表中删除列。唯一列被收集在字符串数组中。 – Prashant