Select Case e.DataCol.Name Case "A","B" If e.DataRow.IsNull("A") OrElse e.DataRow.IsNull("B") Then e.DataRow("C")=Nothing e.DataRow("D")=Nothing ElseIf e.DataRow("B") ="甲" Then Dim de As DataRow = e.DataRow Dim pe As DataRow = DataTables("表2").Find("A= '" & de("A") & "'") If pe IsNot Nothing Then de("C") = pe("M") de("D") = pe("N") End If ElseIf e.DataRow("B") ="乙" Then Dim de As DataRow = e.DataRow Dim pe As DataRow = DataTables("表3").Find("A= '" & de("A") & "'") If pe IsNot Nothing Then de("C") = pe(("M")) de("D") = pe("N") End If ElseIf e.DataRow("B") ="丙" Then Dim de As DataRow = e.DataRow Dim pe As DataRow = DataTables("表4").Find("A= '" & de("A") & "'") If pe IsNot Nothing Then de("C") = pe(("M")) de("D") = pe("N") End If End If End Select
|