Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Iif(isdbnull correct syntax?
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00736677
Message ID:
00739118
Views:
19
Hi Mike,

What is happening, is .NET is evaluating the false expression, even though the IIf statement is true. It will return the true result but if the false portion causes an error, the error will be thrown.

>I was getting the same error until I switched to a standard If statement as follows.
>
>MyEmailBody = myDataRow("AccountId") & " " & _
>myDataRow("OrderNumber")
>IF Not IsDBNull(myDataRow("APN")) THEN
> myDataRow &= " " & Trim(myDataRow("APN")))
>END IF
>IF Not IsDBNull(myDataRow("StreetNumber")) THEN
> myDataRow &= " " & Trim(myDataRow("StreetNumber")))
>END IF
>
>Not sure why the IIF acts the way it does - Would like to find out
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform