在vb.net中使用lamba获取数据表差异
使用VB.NET和lambda,我试图检索第一个数据表(table01)中不在第二个数据表(table02)中的所有记录。但却无法实现这一目标:在vb.net中使用lamba获取数据表差异,vb.net,lambda,Vb.net,Lambda,使用VB.NET和lambda,我试图检索第一个数据表(table01)中不在第二个数据表(table02)中的所有记录。但却无法实现这一目标: Dim newList = table01.AsEnumerable().Where(Function(x) Not table02.AsEnumerable().Any(Function(x1) x1.Field("CustomerNumber") = x.Field("CustomerNumber") AndAlso x1.Field("Custo
Dim newList = table01.AsEnumerable().Where(Function(x) Not table02.AsEnumerable().Any(Function(x1) x1.Field("CustomerNumber") = x.Field("CustomerNumber") AndAlso x1.Field("CustomerId") = x.Field("CustomerId") AndAlso x1.Field("DetailID") = x.Field("DetailID")))
错误是:
“重载解析失败,因为无法使用这些参数调用可访问的“Where”
不确定我遗漏了什么,但它不喜欢Where子句。谢谢。您没有说明为什么“无法使其工作”,但该方法有一个您没有提供的通用参数-例如
x.Field(整数)(“CustomerId”)
(替换适当的类型)。谢谢。我已经更新了文本。错误为“重载解析失败,因为无法使用这些参数调用可访问的“Where”