out of curiosity

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,

i have the following 2 scenarios, 1 works the other doesn't:

this works:

If IsDBNull(e.Item.DataItem("DateField")) Then
e.Item.Cells(DATE_APPROVED).Text = String.Empty
Else
e.Item.Cells(DATE_APPROVED).Text = "a value"
End If

this doesn't work (it appears to execute the false part when the function
actually returns true in the Command window.)

textbox1.text=iif(IsDBNull(e.Item.DataItem("DateField")), String.Empty,
"false part")


thanks,
rodchar
 
Be aware that IIf is a method and as such all arguments are evaluated when
you call this method - i.e., the true and false parts are always evaluated.
(this is in contrast to the behavior of the ternary or '?' operator in C#,
which is not a function).
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up outdated VB.NET code
 
Back
Top