Quantcast
Viewing all articles
Browse latest Browse all 4

Answer by bdukes for Using VB.NET IIF I get NullReferenceException

IIf is an actual function, so all arguments get evaluated. The If keyword was added to VB.NET 2008 to provide the short-circuit functionality you're expecting.

Try

logLine = "e.Value: "+ If(e.Value Is Nothing, "", e.Value.ToString())

Viewing all articles
Browse latest Browse all 4

Trending Articles