Does anyone know how i can insert a null value for a date. My code looks like this:
Dim dtEndDate As Date
If txtEndDate.Text = String.Empty Then
dtEndDate = DBNull.Value
^DOES NOT LIKE THIS ^
^SAYS VALUE OF SYSTEM.DBNULL CANNOT BE CONVERTED TO DATE^
^I MUST INSERT A NULL IF ETXTBOX IS EMPTY ^
Else
dtEndDate = txtEndDate.Text
End If
INSERT INTO PROCESS_PERIOD (EndDate) VALUES ( '" & dtEndDate & "')"
Any help with this would be greatly appreciated
Dim dtEndDate As Date
If txtEndDate.Text = String.Empty Then
dtEndDate = DBNull.Value
^DOES NOT LIKE THIS ^
^SAYS VALUE OF SYSTEM.DBNULL CANNOT BE CONVERTED TO DATE^
^I MUST INSERT A NULL IF ETXTBOX IS EMPTY ^
Else
dtEndDate = txtEndDate.Text
End If
INSERT INTO PROCESS_PERIOD (EndDate) VALUES ( '" & dtEndDate & "')"
Any help with this would be greatly appreciated