I get values from my DataTable from the database, and the data I get are in decimals example (20160901) which in this case would be September 01, 2016 but I can not convert it to date format with the method Convert.ToDateTime ( );
Does anyone know how I can do it?
I attach part of the code:
DateTime iDateInicio = Convert.ToDateTime(ds.Tables[1].Rows[0]["DESC"].ToString());
DateTime iDateFin = DateTime.Now;
// Here I get the data
for (DateTime dt = iDateInicio; dt <= iDateFin; dt = dt.AddDays(1))
{
if (iMesBandera != dt.Month)
{
iHeaderFinal = iii - 1;
e.HeaderRange[Helper.GetColumnNameNew(iHeaderInicial).ToString() + "8:" + Helper.GetColumnNameNew(iHeaderFinal).ToString() + "8"].Cells.Merge();
iHeaderInicial = iii;
iMesBandera = dt.Month;
}
iii++;
}
// this is the functionality of my journey.