If e.DataCol.name = "出生日期" Then If e.newvalue <> Nothing Then Dim y As Integer = e.NewValue.year If format(e.newvalue, "MMdd") <= Format(Date.Today, "MMdd") Then e.DataRow("年龄") = Date.Today.Year - y Else e.DataRow("年龄") = Date.Today.Year - y -1 End If Else e.DataRow("年龄") = Nothing End If End If