11-04-22, 01:41 AM
كود :
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim d1 As DateTime
Dim d2 As DateTime
For i As Integer = 0 To dataGridView1.RowCount - 1
d1 = Convert.ToDateTime(dataGridView1.Rows(i).Cells(2).Value)
d2 = Convert.ToDateTime(dataGridView1.Rows(i).Cells(1).Value)
Dim ts As TimeSpan = d1 - d2
dataGridView1.Rows(i).Cells(3).Value = ts.Days
Next
End Sub
