DateTime sDate;
DateTime eDate;
string strDtFrom = string.Empty;
string strDtTo = string.Empty;
if (dtForIncorrectData != null && dtForIncorrectData.Rows.Count > 0)
{
System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("en-GB");
strDtFrom = dtForIncorrectData.Rows[0]["Date"].ToString();
strDtTo = dtForIncorrectData.Rows[dtForIncorrectData.Rows.Count - 1]["Date"].ToString(); DateTime.TryParseExact(strDtFrom, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out sDate); DateTime.TryParseExact(strDtTo, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out eDate);
dtpFromDate.Value = sDate;
dtpToDate.Value = eDate;
}
DateTime eDate;
string strDtFrom = string.Empty;
string strDtTo = string.Empty;
if (dtForIncorrectData != null && dtForIncorrectData.Rows.Count > 0)
{
System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("en-GB");
strDtFrom = dtForIncorrectData.Rows[0]["Date"].ToString();
strDtTo = dtForIncorrectData.Rows[dtForIncorrectData.Rows.Count - 1]["Date"].ToString(); DateTime.TryParseExact(strDtFrom, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out sDate); DateTime.TryParseExact(strDtTo, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out eDate);
dtpFromDate.Value = sDate;
dtpToDate.Value = eDate;
}
No comments:
Post a Comment