If e.DataCol.name = "出生年月" Then If e.newvalue <> Nothing Then
Dim d As Date = New Date(e.newvalue.substring(0,4), e.newvalue.substring(5,2), 1) Dim y As Integer = d.year If format(d, "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