Closed. This question is
CodePudding user response:
There is a blank/space at the end of your 'date' string. Use bgdate.Trim()
. You may also check that bgdate is a non null string and have then a default value with something like (bgdate == null)?"01-01-1970":bgdate.Trim()
.
CodePudding user response:
There's a white space in your value 08-04-2021
. You should Trim()
it:
bgdate.Trim()