How to calculate days in between two datetimepicker..??

Posted by Rock_Monu under ASP.NET on 8/28/2012 | Points: 10 | Views : 1191 | Status : [Member] | Replies : 1
how to calculate days by two datetimepicker and this days insert in datagridview columns.




Responses

Posted by: Vijay.K on: 9/6/2012 [Member] Starter | Points: 25

Up
0
Down
try this...inside button click...

If DateTimePicker1.Value > DateTimePicker2.Value Then Exit Sub

TextBox1.Clear()

Dim D As Date = DateTimePicker1.Value

Do While D.Day <= DateTimePicker2.Value.Day

'code to do something with date
TextBox1.AppendText(D.ToString)

D = D.AddDays(1)
Loop

End Sub


vijay.k

Rock_Monu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response