Hi,
along with
DateTime.TryParseExact
, you can make use of regular expressions.
use below expression for mm-dd-yyyy.
/^(0[1-9]|1[012])[/ -.](0[1-9]|[12][0-9]|3[01])[/ -.](19|20)\d\d+$/
refer article
The 30 Minute Regex Tutorial[
^] for more on regular expressions.
hope it helps.