R
Ronald S. Cook
Sorry to post this here, but there's not much talent on the VB board (yes,
kissing up in hopes for some help).
I'm simply trying to add a "(Please Select)" row to a combobox in a Windows
form. But, since it's LINQ, I'm in unfamiliar territory.
In the below, it seems like I must have (Of Lookup) in order for the .Concat
method to be available.
But when I run it, it says it can't convert _IQueryable2 from type Lookup to
type Anonymoyus.
************************************************************
Dim _IEnumerable As IEnumerable
Dim _IQueryable1 As IQueryable(Of Lookup) = _
From lk In dc.Lookups _
Where lk.LookupCode <> "INA" _
And lk.LookupGroup = LookupGroup
Dim _IQueryable2 As IQueryable(Of Lookup) = _
From lk In dc.Lookups _
Select LookupId = "00000000-0000-0000-0000-000000000000", _
LookupCode = "XXX", _
LookupValue = "(Please Select)"
Dim _IQueryable3 As IQueryable = _
_IQueryable1.Concat(_IQueryable2)
_IEnumerable = _IQueryable3
Return _IEnumerable
************************************************************
Am I on the right track at all? Any guidance would be greatly appreciated.
Thanks,
Ron
kissing up in hopes for some help).
I'm simply trying to add a "(Please Select)" row to a combobox in a Windows
form. But, since it's LINQ, I'm in unfamiliar territory.
In the below, it seems like I must have (Of Lookup) in order for the .Concat
method to be available.
But when I run it, it says it can't convert _IQueryable2 from type Lookup to
type Anonymoyus.
************************************************************
Dim _IEnumerable As IEnumerable
Dim _IQueryable1 As IQueryable(Of Lookup) = _
From lk In dc.Lookups _
Where lk.LookupCode <> "INA" _
And lk.LookupGroup = LookupGroup
Dim _IQueryable2 As IQueryable(Of Lookup) = _
From lk In dc.Lookups _
Select LookupId = "00000000-0000-0000-0000-000000000000", _
LookupCode = "XXX", _
LookupValue = "(Please Select)"
Dim _IQueryable3 As IQueryable = _
_IQueryable1.Concat(_IQueryable2)
_IEnumerable = _IQueryable3
Return _IEnumerable
************************************************************
Am I on the right track at all? Any guidance would be greatly appreciated.
Thanks,
Ron