我想将DOB
变量赋值为null。
Dim DOB As Date = DTPSdob.Value
Dim datestring As String = DOB.ToString("d")
If chkSdob.Checked = False Then
DOB = 'I want to assign here DOB variable as null'
Else
DOB = datestring
End If
使用可为空的日期时间
Dim DOB As Nullable(Of Date) = Date.Now
Dim datestring As String = DOB.Value.ToString("d")
DOB = Nothing
dim DOB as object = nothing
If chkSdob.Checked = True Then
DOB = datestring
end if