Null Date in Databinder.Eval(Container.DataItem, "decom")
Posted on 2006-05-28
I have an asp:repeater that has a problem when trying to display a NULL DATE value from an SQL database.
<%# Databinder.Eval(Container.DataItem, "myDate") %>
If I put in a function to check for a NULL value first, it still doesn't like the type being passed in (DBNull.Value or System.DateTime) I'm stuck with one or the other.
<%# doMyDateCheck(Databinder.Eval(Container.DataItem, "myDate")) %>
Function doMyDateCheck(ByVal myDate As System.DateTime)
'I get an error when I pass in the code as DBNull or DateTime depending on which I declare and which gets passed in.(opposites generate error)
Any suggestions on how to display the info in a repeater if it is a dateTime OR if it is a NULL date?