If e.DataCol.name = "出生日期" Then
if e.DataRow.IsNull("出生日期") Then
e.DataRow("星座") = Nothing
Else
Dim Ls1 As String() ={"摩羯座" ,"水瓶座","双鱼座","白羊座","金牛座","双子座"}
Dim Ls2 As String() ={"巨蟹座","狮子座","处 女座","天秤座","天蝎座","射手座"}
Dim s1 As New List(of String)
s1.AddRange(Ls1)
s1.AddRange(Ls2)
Dim b As Date = e.DataRow("出生日期")
Dim n As Integer = Math.Ceiling((b.month*100 +b.day)/121)
e.DataRow("星座") = s1(n-1)
End If
End If
[此贴子已经被作者于2011-8-6 23:24:08编辑过]