I have a datagrid and one of the fields from the DB may return a null value. How can I test if it does?
<ItemTemplate>
<%# Container.DataItem ("Display_Start_Date").ToShortDateString()%>
</ItemTemplate>
Printable View
I have a datagrid and one of the fields from the DB may return a null value. How can I test if it does?
<ItemTemplate>
<%# Container.DataItem ("Display_Start_Date").ToShortDateString()%>
</ItemTemplate>
<ItemTemplate>
<%# IIF(IsDBNull(Container.DataItem ("Display_Start_Date"))," - NULL - ", Container.DataItem ("Display_Start_Date").ToShortDateString())%>
</ItemTemplate>
damn!
still the same error..
Public member 'ToShortDateString' on type 'DBNull' not found.
is this the proper syntax...
<%# IIF(IsDBNull
shouldn't it be something like
<%# IIF(Is DBNull.Value