菜鸟求系统时间与某列的日期差,单位为“天”,不知道下面的代码哪里写错了,求助,谢谢
Select Case e.DataCol.name
Case "第八列",e.NewValue(Date.Today)
Dim dr As DataRow = e.DataRow
Dim d2 As Date = Date.Today
d2 = e.NewValue(Date.Today)
If dr.IsNull("第八列") Or dr.IsNull(d2) Then
dr("第九列") = Nothing
Else
Dim tp As TimeSpan
tp = dr(d2) - dr("第八列")
dr("第九列") = tp.Days & "天" '真正的时段型数据要转换为秒数,才能存入时段列
End If
End Select