Hi All,
I have Nullable properties in my class:
I assumed I would be able to store null values in the property. But when I try to assign a value from a datatable row like this:Code:Public Property FileStatusID() As Integer? Get Return m_FileStatusID End Get Set(ByVal value As Integer?) m_FileStatusID = value End Set End Property
I get an Invalid Cast error when a null value is encountered. Do I have to do an ISDBNull check?? what's the best way?Code:File.FileStatusID = filetable.Rows(0)("FileStatusID")




Reply With Quote