【发布时间】:2020-06-26 22:29:39
【问题描述】:
我似乎对 Linq 有一个大致的理解问题。我已经尝试在其他线程中找到答案,但没有成功。 为什么这个查询不起作用?我有两张表:一张包含客户数据,另一张包含订单数据,现在尝试加入它们。但它失败了,我还不明白为什么?在我看来,它与任何其他教程一样。
IEnumerable<DataRow> query = from cust_ in Cust.AsEnumerable()
join order_ in Orders.AsEnumerable() on cust_.Field<int>("ID") equals order_.Field<int>("Customer ID")
select new { customer = cust_.Field<string>("LastName") }
这是它抛出的错误消息:
无法将类型“System.Collections.Generic.IEnumerable>”隐式转换为“System.Collections.Generic.IEnumerable
'。存在显式转换(您是否缺少演员表?
【问题讨论】:
-
这是它抛出的错误消息:无法将类型'System.Collections.Generic.IEnumerable>'隐式转换为'System.Collections.Generic.IEnumerable
'。存在显式转换(您是否缺少演员表? -
您也可以在发布后将信息添加到您的帖子中。只需点击帖子下方的edit。