For Each dr As DataRow In d.datarows msgbox("执行了吗") Dim fdr As DataRow = dt.Find("编码 = '" & dr("cpbm") & "'") msgbox("执行") If fdr Is Nothing Then dr("是否NewBom") = "否" Else dr("是否NewBom") = "是" End If Next