Dim duedate As Date = dtpBorrow.Value Dim tsTimeSpan As TimeSpan Dim noOfDays As Integer tsTimeSpan = Now.Subtract(duedate) noOfDays = tsTimeSpan.Days txtFine.Text = (noOfDays.ToString())
Now is my EndDate.
duedate is my startdate.
basically this code works fine, and gets the number of days between dates but it depends on the dgv row. what i mean is that my dtpBorrow changes depending on the row that i click. what i want to happen is to have another textbox that will contains the total number of days.
still considering that now is my endDate:
dgvRow 1 puts a date of 7/25/12 into dtpBorrow : 7/25/12 - 7/31/12 = 6 (6 is achieved through the code)
dgvRow 2 puts a date pf 7/26/12 into dtpBorrow : 7/26/12 - 7/31/12 = 5 (5 is achieved through the code)
so all in all i have 11. how can i achieve it through codes?