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
当用户想要分配整数""
时会发生什么?Item(DurationColumn)
我得到一个例外。有什么干净的解决方案可以避免这种情况并设置0
为""
?