still it returns false
1 Like
My question
I have a sheet, it may or may not have data
if it has data → [MM-dd-yyyy] format
now i need to compare if this [MM-dd-yyyy] is already present in that sheet
Let’s try this once as this should handle empty or null cells as well.
dt_Schedule.AsEnumerable().Any(Function(r) Not IsDBNull(r(0)) AndAlso Not String.IsNullOrWhiteSpace(r(0).ToString()) AndAlso DateTime.ParseExact(r(0).ToString(), "MM-dd-yyyy", System.Globalization.CultureInfo.InvariantCulture).Date = DateTime.Now.AddDays(-1).Date)
still throwing false