In DataTable i have this format mm/dd/yyyy hh:mm:ss AM
I want to change format to “dd.MM.yyyy”
foreach (DataRow dr in dt.Rows)
{
dr["birth_day"]= String.Format("{0:dd.MM.yyyy}",dr["birth_day"]);
}
It gave me this error:
String was not recognized as a valid DateTime.Couldn’t store <25.04.1988> in birth_day Column. Expected type is DateTime.
String format needs more than one argument, one for the string, and 1-n for each variable you have in the string.
e.g.
Though i am still not sure this would give what you want