Answered Contoso Construction error....

  • Friday, August 31, 2012 4:49 AM
     
     

    Contoso Construction gives me this error when I run the Custom Report Filter using the "Where Customer > Nothing".  It runs fine with "Where Customer = Not Nothing".  Tried several things but couldn't get it to work.

    Error:

    The binary operator GreaterThan is not defined for the types 'LightSwitchApplication.Customer' and 'System.Object'.


    Edward Piccoli

All Replies

  • Saturday, September 01, 2012 11:46 AM
    Moderator
     
     Answered Has Code

    You can't treat "Nothing" in the same way that you would with say an Integer value.

    The comparison you need is:

    If (x Is Nothing) Then...
    
    'or
    
    If (x IsNot Nothing) Then...


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    If you find a reply helpful, please click "Vote as Helpful", if a reply answers your question, please click "Mark as Answer"
     
    By doing this you'll help people find answers faster.

    • Marked As Answer by Dino HeModerator Wednesday, September 05, 2012 12:21 PM
    • Unmarked As Answer by Spaceworld Wednesday, September 05, 2012 12:31 PM
    • Marked As Answer by Spaceworld Wednesday, September 05, 2012 12:31 PM
    •