原代码执行报错
If DataTables("订单").DataRows.Count = 0 Then '如果订单表没有数据
DataTables("订单明细").LoadFilter = "订单ID Is Null" '不加载订单明细
Else
Dim ids As String
For Each dr As DataRow In DataTables("订单").DataRows
ids = ids & "," & dr("订单ID")
Next
ids= ids.Trim(",")
DataTables("订单明细").LoadFilter = "订单ID In (" & ids & ")"
End If
DataTables("订单明细").Load()
红字部分改后通过,是不是帮助上的代码错了?
If DataTables("订单").DataRows.Count = 0 Then '如果订单表没有数据
DataTables("订单明细").LoadFilter = "订单ID Is Null" '不加载订单明细
Else
Dim ids As String
For Each dr As DataRow In DataTables("订单").DataRows
ids = ids & "," & "'" & dr("订单ID") & "'"
Next
ids= ids.Trim(",")
DataTables("订单明细").LoadFilter = "订单ID In (" & ids & ")"
End If
DataTables("订单明细").Load()