这样试试:
Select Case e.DataCol.Name
Case "读数时间","读数间隔时间"
Dim dr As DataRow
Dim drs As List(of DataRow)
Dim tp1 As New TimeSpan(24,00,00)
dr = e.DataTable.Find("[_SortKey] < " & e.DataRow("_SortKey"), "[_SortKey] Desc")
If dr Isnot Nothing Then
e.DataRow("读数间隔时间") = e.DataRow("读数间隔时间")
dr = e.DataRow
drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey"), "[_SortKey]")
For i As Integer = 1 To drs.Count - 1
drs(i)("读数间隔时间") = drs(i)("读数时间") - drs(i-1)("读数时间") + tp1
Next
End If
End Select