Quantcast
Channel: Nullable and IIf
Viewing all articles
Browse latest Browse all 9

Nullable and IIf

$
0
0

If waa is a Nullable(of Integer), why doesn't this work when waa is null?

Iif(waa.HasValue, waa.Value.ToString(), ""

I get an error "Nullable object must have a value."

Don't tell me Iif is evaluating the true part before the test?

I'm working inside a LINQ literal at the time I get the error:

dim x = <waa><%= CStr(Iif(waa.HasValue, waa.Value.ToString(), "")) %></waa>  
 


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>