Datetime in a For loop
I have a for loop on a date that never counter
increases. I didn't see the reason. Can you help me?
private void ubGO_Click(object sender, EventArgs e)
{
DateTime startDate = udteMin.DateTime.Date;
DateTime endDate = udteMax.DateTime.Date;
for (DateTime counter = startDate; counter <= endDate; counter.AddDays(1))
{
MessageBox.Show(counter.Date.ToString() + " " + counter.AddDays(1).Date.ToString());
}
}
+3
source to share