Select Case e.DataCol.Name Case "到期日期" Dim dr As DataRow = e.DataRow If dr.IsNull("到期日期") Then dr("保质时间") = Nothing Else Dim tp As TimeSpan = dr("到期日期") - Date.Now dr("保质时间") = tp.Days & ":" & tp.Hours End IfEnd Select