I have the following cycle for to recover from 0 to 24 hours of a data converted to string in which the elements that do not exist add them to me but I also want to do it with the dates, the problem is not to pass the data to string but to identify what day and year you should have in a time range.
for (int ii = 0; ii <= 24; ii++)
{
DataRow[] dr = rs.Tables[0].Select("HOURS = " + (ii < 10 ? "0" : "") + ii.ToString());
if (dr.Length == 0)
{
DataRow drnew = rs.Tables[0].NewRow();
rs.Tables[0].Rows.Add((ii < 10 ? "0" : "") + ii.ToString() + ":00:00");
}
}