If @bookingdate
is already a DateTime
parameter then leave it alone. The database doesn't care about the string representation of the date - the underlying date/time is the same regardless of how you decide to format it when you call ToString
.
(ie, Just comment-out the entire chunk of code shown in the question and see if that works.)
Regarding your most recent edit and comments, I suspect that you simply need to do something like this:
Dim dt As DateTime = DateTime.ParseExact(InputBookingdatesingleday.Text,
"dd/MM/yyyy",
CultureInfo.GetCultureInfo("en-GB"))
command.Parameters.AddWithValue("@bookingdate", dt)