I have a datagrid that gets populated when the page is selected. One of my fields is a date field, so I formated it: Container.DataItem ("Start_Date").ToShortDateString. In the DB this field can be NULL so in my code I check for DBNULL:
I still get this error when a NULL field is returned:Code:<%# IIF(IsDBNull(Container.DataItem ("Display_Start_Date")), "", Container.DataItem,Container.DataItem ("Display_Start_Date").ToShortDateString())%>
Public member 'ToShortDateString' on type 'DBNull' not found.
any suggestions? is there another way to format the date in a datagrid so it doesn't return the time?
thanks..




Reply With Quote