Hi over there,
I hope this question is not too simple, but I didn't manage to figure out why...
I would need an explanation for following issue:
I'm reading data from a database (MSSQL) and it the column "PersonBirthday" is DBNull.
I wanted to prevent the error (Textbox.Text = DBNull) with an IIF. The thing is I get this
"Conversion from type 'DBNull' to type 'Date' is not valid."
This code is NOT working, why?
txtPersonBirthday.Text = IIf(IsDBNull(.Item("PersonBirthday")) =
When I'm using this code, which is for me obviously the same, just with an if-block it works,
and I want to know why - please explain.
If IsDBNull(.Item("PersonBirthday")) Then
txtPersonBirthday.Text = String.Empty
txtPersonBirthday.Text = CDate(.Item("PersonBirthday")).ToString("yyyy-MM-dd")
View Complete Post