AddDays() not working within a while loop
- by r0bb077
Is there anything that stops the DateTime AddDays() method that doesn't run within a while loop. I have this simple bit of code;
DateTime last_day = monthCalendar2.SelectionRange.End;
DateTime first_day = new DateTime(year, month, day);
//Insert dates into vector
while (first_day != last_day)
{
dates.Add(first_day);
first_day.AddDays(1);
}
I step through the program and first_day never changes, anyone know why?!