I made a date picker from the calendar control in ASP.net using C#. The date format in the TextBox is 08/01/2012.
When I try to do an insert I get this error:
Message: Input string was not in a correct format.
here is my code:
cmd.Parameters.Add("@date", SqlDbType.DateTime).Value =
Convert.ToDateTime(txtDateins.Text);
How do I get that fixed ?
I had my table column defined as 15,2 and then I changed it to 18,2 and everything is working. I don’t know why that happened. I am hoping to find a reason.