Your
Date
column has probably the type
DATETIME
. When then passing a date only string using
dateTimePicker4.Value.Date.ToString()
, that will be extended to a
DATETIME
with the time portion set to 00:00:00 and only those records match that have that time.
You have to specify that you only want to compare the date portion:
sql = String.Concat("DELETE FROM UNICJK WHERE CAST(Date AS DATE) = '", dateTimePicker4.Value.Date.ToString(), "'");
In your case it would be even better to use a parameterised command to avoid passing dates formatted as strings:
da.DeleteCommand = new SqlCommand("DELETE FROM UNICJK WHERE CAST(Date AS DATE) = CAST(@PickerDate AS DATE)", conn);
da.DeleteCommand.Parameters.AddWithValue("@PickerDate", dateTimePicker4.Value)