循环mysql选择查询

时间:2017-11-25 04:11:20

标签: mysql vb.net

For Each row In Item_Get(42, returnno)
    Dim barcode As String = Item_Get(42, returnno)
    Dim wh, sa, bo As Integer
    wh = Stat_Get(0, barcode)
    sa = Stat_Get(1, barcode)
    bo = Stat_Get(2, barcode)
    chk = Stock_Chk(0, barcode)
    If chk = True Then
        Stock_Update(barcode, wh, sa, bo)
    Else
        Stock_Save(barcode, wh, sa, bo)
    End If
Next

item_get(42, returno)查询是"从tblreturn选择条形码为str status = '1' and returnno = @chk"

问题是它没有循环返回整个结果。有人能帮我一下吗 ?

1 个答案:

答案 0 :(得分:0)

For循环中,您不应该从Item_Get(42, returnno) 获取数据,而是从row获取数据。这意味着像Dim barcode As String = row.item(0)