【发布时间】:2013-08-12 12:36:15
【问题描述】:
我有两个集合,我必须进行连接才能获得一个值,但是当我尝试它时抛出错误。
//代码:
Dim ExclusiveComment As ExclusiveComments = Nothing
ExclusiveComment = From ExclusiveCommentLinq In Me.ExclusiveCommentsCollection
Join ExistingCommentsLinq In Me.CombinedExclusiveCommentsCollection On ExclusiveCommentLinq.CommentDescription Equals ExistingCommentsLinq(0)
Select ExclusiveCommentLinq
在上面的代码中,
ExclusiveCommentsCollection= 类的集合(ExclusiveComments)
CombinedExclusiveCommentsCollection = 常规字符串集合(单列)
两个集合都有共同的列“CommentDescription”,我需要使用它从ExclusiveCommentsCollection获取值。
你能告诉我我错在哪里以及如何做到这一点吗?
错误:
Option strict on 不允许从 'System.collections.generic.ienumarable(Of ExclusiveComments 到 ExclusiveComments) 的隐式转换
【问题讨论】:
标签: .net vb.net linq collections