Dim payorProvidersList = (From pp In payorProviders
Group Join p In accPayors On p.PayorCode Equals pp.PayorCode Into gpPP = Group From p In gpPP.DefaultIfEmpty()
Group Join hpc In hipaaPayorConnectors On hpc.ConnectorId Equals pp.ConnectorID And hpc.PayorCode Equals pp.PayorCode And hpc.TransactionType Equals pp.TransactionType Into gpHPC = Group From hpc In gpHPC.DefaultIfEmpty()
Select New PayorProvidersInfo With
{
.ID = pp.ID,
.PayorCode = pp.PayorCode,
.ProviderId = pp.ProviderId,
.CreatedBy = pp.CreatedBy,
.CreatedDate = pp.CreatedDate,
.UpdatedBy = pp.UpdatedBy,
.UpdatedDate = pp.UpdatedDate,
.ConnectorID = pp.ConnectorID,
.NPI = pp.NPI,
.Order = hpc.Order,
.TransactionType = pp.TransactionType,
.PayorName = If(p IsNot Nothing AndAlso p.PayorName IsNot Nothing, p.PayorName, "Unknown"),
.EmdeonPayorName = If(p IsNot Nothing AndAlso p.EmdeonPayorName IsNot Nothing, p.EmdeonPayorName, "Unknown")}).ToList()
Asked
Active
Viewed 284 times
0

Sateesh Pagolu
- 9,282
- 2
- 30
- 48

sujeet
- 1
- 1
-
2You should tell us which line is causing the exception. – Sateesh Pagolu Feb 20 '17 at 06:01
-
BTW, it is VB.net, not c#. – Sateesh Pagolu Feb 20 '17 at 06:06
-
line 3. 'hpc.ConnectorId' threw an excpetion of type 'System.NullReferenceException'. – sujeet Feb 20 '17 at 06:18
-
'hpc.ConnectorId' is of integer type and is NULL in database for some records. – sujeet Feb 20 '17 at 06:21
1 Answers
0
Replace hpc.ConnectorId
with If(hpc.ConnectorId, 0)
.
Edit:
Based on your comments, your issue is not with integer field, but with hpc
object itself.
Try replacing hpc.ConnectorId
with If(hpc is nothing, 0,hpc.ConnectorId)

Sateesh Pagolu
- 9,282
- 2
- 30
- 48
-
tried this but but getting complie time error, so used this If(CType(hpc.ConnectorId, Integer?), 0). But again getting same error. – sujeet Feb 20 '17 at 06:34
-
-
System.NullReferenceException{"Object reference not set to an instance of an object."} – sujeet Feb 20 '17 at 07:00
-
That cannot be compile time error. What is the compile time error you get when u use `If(hpc.ConnectorId, 0)`? – Sateesh Pagolu Feb 20 '17 at 07:01
-
Showing compile error as -- First operand in a binary 'If' expression must be nullable or a reference type. – sujeet Feb 20 '17 at 07:06
-
Again getting compile error - Value of Type 'ConnectorInfo' cannot be converted to 'Boolean'. – sujeet Feb 20 '17 at 07:22
-