Select Case e.DataCol.name
Case "入井时间","升井时间"
Dim dr As DataRow = e.DataRow
If dr.IsNull("入井时间") Or dr.IsNull("升井时间") Then
dr("计时") = Nothing
Else
Dim tp As TimeSpan
If dr("升井时间") > dr("入井时间")
tp = dr("升井时间") - dr("入井时间")
dr("计时") = tp.TotalSeconds()
Else
tp = cdate(dr("升井时间")).adddays(1) - cdate(dr("入井时间"))
dr("计时") = tp.TotalSeconds() '真正的时段型数据要转换为秒数,才能存入时段列
End If
End If
End Select