-- [求助]关于datatablesFIND用法的疑问
如下代码红色处如果是查询表则可以,只是table表就不行,这是什么原因?
Dim dr As DataRow = e.DataRow
Dim pr As DataRow
Dim pr1 As DataRow
Dim pr2 As DataRow
Dim pr3 As DataRow
Select Case e.DataCol.Name
Case "生产任务单号"
If dr("核算确认")<>"Y" Then
Dim filter As String
filter = "编号 = \'" & dr("生产任务单号") & "\'"
pr = DataTables("worksql003").Find(filter)
If pr IsNot Nothing Then
If pr.IsNull("销售订单号") Then
dr("订单号") = pr("预测单号")
Else
dr("订单号") = pr("销售订单号")
End If
End If
Dim filter1 As String
Dim filter2 As String
filter1 = "单据编号 = \'" & dr("订单号") & "\'"
filter2 = "编号= \'" & dr("订单号") & "\'"
pr1 = DataTables("销售订单序时簿sql").Find(filter1)
pr2 = DataTables("预测订单sql").Find(filter2)
If pr1 IsNot Nothing Then
dr("产品编码") = pr1("产品长代码")
ElseIf pr2 IsNot Nothing Then
dr("产品编码") = pr2("物料长编码")
End If
If dr.IsNull("产品编码")=False Then
Dim filter3 As String
filter3 = "产品长代码= \'" & dr("产品编码") & "\'"
pr3 = DataTables("装配产品系数表").Find(filter3)
If pr3 IsNot Nothing Then
dr("产品类型") = pr3("产品类型")
End If
End If
End If
End Select