How to modify / change / update or replace value as date in data table cell using LINQ?

Hi @prasath17,
thanks for quick response.
How to handle error?

RemoteException wrapping System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.  ---> RemoteException wrapping System.ArgumentException: String was not recognized as a valid DateTime.Couldn't store <15-07-2020 14:12:12> in Date1 Column.  Expected type is DateTime.  ---> RemoteException wrapping System.FormatException: String was not recognized as a valid DateTime.

I have invoked code:

DT_Missings.AsEnumerable().ToList().ForEach(Sub(row) row("Date1")=DateTime.ParseExact(row("Date1").ToString,"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy HH:mm:ss"))
DT_Missings.AsEnumerable().ToList().ForEach(Sub(row) row("Date2")=DateTime.ParseExact(row("Date2").ToString,"MM/dd/yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MM-yyyy"))
2 Likes