Dim dr As DataRow = e.DataRow Select Case e.DataCol.Name Case "员工编号","姓名","年度" Dim filt As String = "姓名 = '" & dr("姓名") & "'And 员工编号 = '" & dr("员工编号") & "' And 年度 = " & dr("年度") Dim fdr As DataRow = DataTables("工资年度汇总").Find(filt) If dr.IsNull("姓名") = False AndAlso dr.IsNull("年度") = False Then If fdr Is Nothing Then Dim ndr As DataRow = DataTables("工资年度汇总").AddNew() ndr("姓名") = dr("姓名") ndr("年度") = dr("年度") ndr("员工编号") = dr("员工编号") ndr.Save() End If End If End Select