Dim dt As DataTable = DataTables("库存")
Dim w As DataRow
st = Date.Now
Dim i As Integer
For Each dr As JToken In JArray.Parse(str)
w = dt.Find("MATNR = '" & CStr(dr("MATNR")) & "' and LGORT = '" & CStr(dr("LGORT")) & "'")
If w IsNot Nothing Then
w("LABST") = CStr(dr("LABST")) '库存数量
w("SOBKZ") = CStr(dr("SOBKZ")) '特殊库存标识
w("CHARG") = CStr(dr("CHARG")) '批次编号
w("VBELN") = CStr(dr("VBELN")) '销售和分销凭证号
w("POSNR") = CStr(dr("POSNR")) '销售和分销凭证的项目号
w("PSPNR") = CStr(dr("PSPNR")) '工作分解结构要素 (WBS 要素)
w("POSID") = CStr(dr("POSID")) '字符字段长度24
w("KUNNR") = Cstr(dr("KUNNR")) '客户编号
w("LIFNR") = Cstr(dr("LIFNR")) '供应商或债权人的帐号
w("WERKS") = CStr(dr("WERKS")) '工厂
i += 1
If (Date.Now - st).TotalSeconds > 10 Then
Output.Show(i)
Return Nothing
End If
Else
End If
Next
Output.Show("处理库存表时间:" & (Date.Now - st).TotalSeconds)
上述代码发现红色部分更新表数据特别慢,这1W条数据需要更新800秒以上,这之前都没这么慢的啊,不知道怎么变这么慢呢?去掉红色部分的更新,瞬间处理掉了,内容都是字符,列也是16位字符