Object variable or With block variable not set on outer linq join multiple objects

Anthony Matovu
Anthony Matovu used Ask the Experts™
on
i have used the linq code like the example below to construct a list of customers with the respective value,

Dim bunds As IEnumerable = (From dr In duse _
                     Group dr By a = dr.Field(Of Decimal)("msisdn") Into grp = Group Select New With
                            { _
                                .msisdn = a, _
                                .data_bytes_bundle = grp.Sum(Function(x) If(x.Field(Of Decimal)("bonus") = 1, x.Field(Of Decimal)("byts"), 0)),
                                .data_bytes_bonus = grp.Sum(Function(x) If(x.Field(Of Decimal)("bonus") = 2, x.Field(Of Decimal)("byts"), 0))
                            }).ToList

I have three list which i want to put into a single collectio using linq, it is failing at  o.msisdn with massage
Object variable or With block variable not set.

 Dim result = (From c In bunds
             Group Join o In core
             On c.msisdn Equals o.msisdn Into co = Group
             From o In co.DefaultIfEmpty() Join p In pcrf On o.msisdn Equals p.msisdn
             Select o.msisdn, o.data_bytes_bundle, o.data_bytes_bonus, o.data_bytes_core, p.byt_pcrf, p.byt_pcrf_bon).ToList

I am failing to get out of this
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial