string[] formats = new[] { "MM.dd.yyyy hh:mm", "dd.MM.yyyy hh:mm", "MM/dd/yyyy hh:mm", "dd/MM/yyyy hh:mm", }; foreach (string format in formats) { try { _ChangedDate = DateTime.ParseExact(dr[ConfigurationManager.AppSettings["ChangedDate"]].ToString(), format,CultureInfo.InvariantCulture); break; } catch { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)