As explained in Solution 1, chances are that when looping through rows, one or more rows do not contain a proper date. Another possible situation that you don't have a date at all, meaning that on some rows thee value is NULL. If this is possible it should be taken into account.
In my opinion the root cause is that you store dates as text in the data table. Instead you should use DateTime as the column type for
date_valide_utilisation
. By doing this you don't need to convert the dates at all.
Another thing is that it looks like you're using a datetimepicker. If that's true, try using
value
property instead of
text
property. Have a look at
DateTimePicker.Value Property (System.Windows.Forms) | Microsoft Docs[
^]
By doing these two changes (column data type and value property) you can remove all text conversions and place the datetime from the datarow directly to the control and vice versa.