I'm passing the date through parameter when I run the update statement it generated the error
Error Unhandled exception has occurred....
The conversion of a varchard data type to a smalldatetime datatype resulted in an out of range values
the values from the string = CustomerRefString is from following code
CustomerRefString = DateTimePicker1.Value.Date
CustomerRefString = CustomerRefString.Replace(vbCr, "").Replace(vbLf, ",")
' VisitIDString = VisitIDString.Replace(",", "")
CustomerRefString = CustomerRefString.Replace(" ", "")
CustomerRefString = CustomerRefString.TrimEnd(MyComma)
myCmd1.CommandText = "UPDATE tblContractSite SET DateInActive = '" & CustomerRefString & "' WHERE cardcolumn IN (" & CardNumString & ")"
The output from above code through MsgBox () shown below
UPDATE tableTarget SET DateInActive = 20/10/2017' where cardcolumn in ('1234')
The field 'DateInActive' type is datetime
Appreciate your help