22-04-20, 02:41 AM
لسلام عليكم ورحمة االله وبركاته
اخواني كيف يتم جمع الوقت الموجود عمود في الداتاقريدفيو علماً أني استخدمت الكود الموجود في الأسفل لكن يعمل أحيانا وأحيانا يظهر لي الخطأ التالي
التحويل من السلسلة "" إلى النوع 'Double' غير صالح.
Dim columnIndex As Integer = 8
Dim h, m As Integer
For Each r As DataGridViewRow In Me.DataGridView2.Rows
If Not IsNothing(r.Cells(columnIndex).Value) Then
h += r.Cells(columnIndex).Value.ToString.Split(":")(0)
m += r.Cells(columnIndex).Value.ToString.Split(":")(1)
End if
Next
If m > 59 Then
h += Math.Floor(m / 60)
m = m Mod 60
End If
Dim result As String = String.Format("{0}:{1}", h, m)
Me.TextBox15.Text = result
لكم جزيل الشكر
دمتم بود