save 0000-00-00 date in mysql
can you help me?
below is the value for my date when it is saved ... my problem is when i save the null value ..error says argument prompt cannot be converted to string..
how about if i'll save
dim s as date ="0000-00-00"
tblEmpCRow("dateterminated") =s
instead of
tblEmpCRow("dateterminated") = DBNull.Value
Code:
If dtpTerm.Checked Then
tblEmpCRow("dateterminated") = dtpTerm.Value
txtTerm.Text = dtpTerm.Text
Else
tblEmpCRow("dateterminated") = DBNull.Value
txtTerm.Text = ""
End If
Re: save 0000-00-00 date in mysql
To save a dummy value in place of NULL is a bad practice.
Instead of doing it, write code to handle the NULL values when you are reading the dates from the table and assigning them to your controls.
.