I've always done something like below to handle dates that can be null
in the DB. Was curious if they (MS) every got around to coming up with
a date data-type that can accept null values. Is there a better way?
Public Property PaymentProcessedDateTime() As DateTime
Get
If Me._PaymentProcessedDateTime Is System.DBNull.Value Then
Return New Date
Else
Return CType(_PaymentProcessedDateTime, DateTime)
End If
End Get
Set(ByVal Value As DateTime)
If Value = New Date Then
_PaymentProcessedDateTime = System.DBNull.Value
Else
_PaymentProcessedDateTime = Value
End If
End Set
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com