Link to home
Start Free TrialLog in
Avatar of onebite2
onebite2

asked on

Checking String Value in vb.net

What is the issue in the if clause below??I am getting 'Object reference not set to an instance of an object.'
This is the clause I need to implement    'if Risk Assessment Type is NOT Equal to "ManualUnderwriting" or Null (or Blank), a valid value is required.  '


Dim inRiskAssmtType As String = GetSafeParsedString(Row.inRISKASSMTTYPE).ToUpper()

If Row.inRISKASSMTTYPE_IsNull = True OrElse inRiskAssmtType <>"MANUALUNDERWRITING" Then
                Throw New Exception("  value is required for ,risk assessment type  '" + Row.inRISKASSMTTYPE.ToString() + "'")
            End If

Thanks in advance!!!!
Avatar of Jared_S
Jared_S

Your exception uses Row.inRISKASSMTTYPE.ToString() in a scenario where Row.inRISKASSMTTYPE can be null.
Avatar of onebite2

ASKER

@Jared_S

how should we change the if statement to match the clause I had??I appreciate if you can change it and give here.


Thanks!!
SOLUTION
Avatar of YZlat
YZlat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial