Ed
asked on
1900-01-01 in date field problem
I have a function that deals with NULLS a datefield.
This works to a point but puts in the date 1900-01-01 when a NULL is entered from FW_DATECOMPLIANTTextBox.Te xT
How can I solve this so it just inputs NULL?
This works to a point but puts in the date 1900-01-01 when a NULL is entered from FW_DATECOMPLIANTTextBox.Te
Dim dtDateCompliant As String = FW_DATECOMPLIANTTextBox.Text
If String.IsNullOrEmpty(dtDateCompliant) Or Not IsDate(dtDateCompliant) Then
FW_DATECOMPLIANTTextBox.Text = ""
dtDateCompliant = System.Data.SqlTypes.SqlDateTime.Null
cmd.Parameters.AddWithValue("@FW_DATECOMPLIANT", dtDateCompliant)
Else
cmd.Parameters.AddWithValue("@FW_DATECOMPLIANT", CDate(dtDateCompliant))
End If
How can I solve this so it just inputs NULL?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER