Why is this LINQ query not working?
I was trying to help someone else and wrote this request:
var foundTab = (from tab in tabControl1.TabPages
where tab.Name == "tabName"
select tab).First();
And they reported that they got this error:
Could not find an implementation of the request pattern for the source type System.Windows.Forms.TabControl.TabPageCollection. "Where" was not found. Consider explicitly specifying the range type for the variable 'tab'.
I checked MSDN and TabPageCollection
implemented IList
, ICollection
, IEnumerable
. So what's going on here? What does this error mean and is there any other way to query the Tab Control property TabPages
?
source to share