How would I shorten this If... Else... statement to check the state of a Date?
        Posted  
        
            by Ian Roke
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Ian Roke
        
        
        
        Published on 2010-04-02T22:36:28Z
        Indexed on 
            2010/04/02
            22:43 UTC
        
        
        Read the original article
        Hit count: 609
        
I am a C# programmer but dabbling in VB.Net because everybody else in my team uses it. In the interests of professional development I would like to shrink the following If... Else... statement.
If cmd.Parameters("@whenUpdated").Equals(DBNull.Value) Then
    item.WhenUpdated = cmd.Parameters("@whenUpdated").Value
Else
    item.WhenUpdated = Nothing
End If
Cheers, Ian.
© Stack Overflow or respective owner