General information
Title:
Iif(isdbnull correct syntax?
Hi,
I encountered the following error message with the code below the error message.
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
Additional information: Cast from type 'DBNull' to type 'String' is not valid.
MyEmailBody = myDataRow("AccountId") & " " & _
myDataRow("OrderNumber") & " " & _
IIf(IsDBNull(myDataRow("APN")), "", Trim(myDataRow("APN"))) & " " & _
IIf(IsDBNull(myDataRow("StreetNumber")), "", Trim(myDataRow("StreetNumber")))
What is the proper code to cancanate the string?
Any help would be greatly appreciated.
Thanks
Roland
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only