Public Property Duration() As Integer
Get
Try
Return CType(Item(DurationColumn), Integer)
Catch e As Global.System.InvalidCastException
Throw New Global.System.Data.StrongTypingException("The value for column 'Duration' in table 'T_MembershipSale' is DBNull.", e)
End Try
End Get
Set(ByVal value As Integer)
Item(DurationColumn) = value
End Set
End Property
What happens when a user wants to allocate ""
as Item(DurationColumn)
to integer? I get an exception. Any clean solution to avoid this and set 0
for ""
?