Error: String was not recognized as a valid DateTime (SOLUTION)


This happens mainly due to the fact that the actual accepted date format is not dd/MM/yyyy as we all prefer to use it, but instead it is MM/dd/yyyy. Therefore, all we need to do is convert it to such format by using ParseExact.

Below is the exact code you will need to solve issue, replace the DateAsString “25/09/2012” to your label, textbox or whatever your requirements.

Continue reading