troubleshooting Question

linq query giving message "Value cannot be null"

Avatar of Anthony Matovu
Anthony MatovuFlag for Uganda asked on
.NET ProgrammingVisual Basic.NETASP.NET
10 Comments1 Solution677 ViewsLast Modified:
Dear Experts,

The code below has come a long way and i am already proud of it. However i am getting a message    "Value cannot be null" of the line that starts with Dim query = From.... I really dont know how to about this .

Thank you

Dim tbl_time As DataTable = ds.Tables("ctime")
        Dim tbl_perhour As DataTable = ds.Tables("perhour")
        Dim tbl_area As DataTable = ds.Tables("areas")
        Dim tbl_basestation As DataTable = ds.Tables("station")
        Dim tbl_country As DataTable = ds.Tables("country")
        Dim tbl_ded As DataTable = ds.Tables("ded")


                Dim query = From obj_perhour In tbl_perhour.AsEnumerable() Join obj_time In tbl_time.AsEnumerable() _
                    On obj_perhour.Field(Of Int64)("time_key") Equals obj_time.Field(Of Int64)("time_key") _
                    Group obj_perhour By customerid = obj_perhour.Field(Of Int64)("msisdn_nsk") _
                                     Into grp = Group _
                       Select New With _
                            { _
                              .msisdn = customerid,
                              .rev_onn_tot_nbn = grp.Sum(Function(x) If(x.Field(Of String)("utype") = "UG", x.Field(Of Decimal)("ccost"), 0))
Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros