以下是引用狐孩儿在2008-9-19 12:32:00的发言: 還是這樣通用些 If CurrentTable.Rows(e.DataRow("_Identify")-1)("日期") IsNot Nothing Then e.DataRow("月份")= CurrentTable.Rows(e.DataRow("_Identify")-1)("日期").Month End if
效率上不说,你的代码能简化成 If e.DataRow("日期") IsNot Nothing Then e.DataRow("月份")= e.DataRow("日期").Month End if