Dim bm1 As String = e.DataRow("所在部门")Dim dr1 As DataRow = DataTables("词典").Find("类别 = '部门'","名称 = '" & bm1 & "'")If dr1 IsNot Nothing Then e.DataRow("部门代码") = dr1("代码")End If
词典表分4列 分别为 类别、小类别、名称、代码
现在需要类别的里的名称为“部门“的行 按照名称列的名称 ,获取代码