Here's what I tried, but I get an error at run time on the AddRange line that states "Only parameterless constructors and initializers are supported in LINQ to Entities."
Code:Private Sub PopulateServiceTypeCodes() ServiceTypeCodeListView.Items.Clear() Using context As New BLUEEXCHANGEEntities Dim query = From stc In context.ServiceTypeCodes Join sbl In context.ServiceBenefitLookups On sbl.ServiceTypeCodeId Equals stc.ServiceTypeCodeId Select New ListViewItem(New String() {stc.ServiceTypeCodeId, stc.ServiceTypeCodeDescription}) ServiceTypeCodeListView.Items.AddRange(query.ToArray) End Using End Sub




Reply With Quote