InvalidCastException

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • imonline

    #1

    InvalidCastException

    Hi,
    I have developed a webservice with OTA compliance using WSCF 0.6.
    Now eveything works fine but the soap messages with paymentcard node is
    giving me following error.

    (70, 29). ---> System.InvalidC astException: Operator '<>'
    is not defined for 'Nothing'
    and type 'PaymentCardTyp e'

    Please let me know what am I doing wrong.

    Regards,
    Nis

  • Chris Dunaway

    #2
    Re: InvalidCastExce ption

    (70, 29). ---> System.InvalidC astException: Operator '<>'
    is not defined for 'Nothing'
    and type 'PaymentCardTyp e'
    >
    Without seeing some code, it's difficult to know what is wrong. It
    appears that you are trying to use the <operator when comparing
    against Nothing, as in

    If x <Nothing Then 'This is not allowed
    'Do something
    End If

    In VB, to check for Nothing, you must use this form:

    If Not x Is Nothing Then
    'Do something
    End If

    Or if you're using .Net 2.0, you can use this:

    If x IsNot Nothing Then
    'do something
    End If


    This is just a guess, though. Post the relevant portion of the code
    and perhaps you could get more help.

    Chris

    Comment

    Working...