You are passing a
string
to the
@DateOfPurchase
parameter. That string does not contain a valid date.
Use
DateTime.TryParse[
^] to attempt to convert the string to a date. If it succeeds, pass the parsed
DateTime
value to the parameter. If it fails, display an error to the user and abort the operation.