0
I’m starting to learn ASP.NET and can’t find solution to the case below:
I have an instance of Datetime where I do the conversion to "ddMMyyyy" format using Parseexact(), to show the date without mask. The problem is that in Oracle this field is not DATETIME, it is just DATE. When I run the program, I get the error "A cadeia de caracteres não foi reconhecida como valor DateTime válido."
I couldn’t find a Date-only object in ASP.NET to use. Do you have any idea how I can solve this? I didn’t want to have to change the field type in the table.
Follow the code excerpt:
else if (field.TYPECODE == 4)
{
DateTime _date = DateTime.ParseExact(field.VALUE, "ddMMyyyy", CultureInfo.InvariantCulture);
field.VALUE = JsonConvert.SerializeObject(_date);
}