Hi! I am a total newbie.. i have a question, consider if i have two dates example... DateTime dt1 = DateTime.Now; DateTime dt2 = dt1.AddDays(45); Now i want to list all the dates in between these and display in a listbox or a lablel.. how do i create a loop? can someone suggest! Thanks in advance Regards
At the moment with your example there would be little point in doing the second line but assuming dt2 is user contribution or such then Dim dt1 As DateTime = Now Dim dt2 As DateTime = Now.AddDays(45) For i As Integer = 0 To DateDiff(DateInterval.Day, dt1, dt2) Label1.Text &= dt1.AddDays(i).ToString("M/d/yy") & "<br />" Next Code (ASP.Net):