用find加sqlfind即可
If e.DataCol.Name = "客户编号" Then
Dim dr As DataRow = DataTables("客户").Find("客户编号 = '" & e.DataRow("客户编号") & "'")
If dr IsNot Nothing Then
e.DataRow("发包单位") = dr("公司名称")
Else
dr = DataTables("客户").sqlFind("客户编号 = '" & e.DataRow("客户编号") & "'")
If dr IsNot Nothing Then
e.DataRow("发包单位") = dr("公司名称")
End If
End If
End If