-- 类“datatable”没有默认属性,因此无法被索引
麻烦大师看一下,下边代码错在哪里,
Dim Vals As List(Of String())
Vals = DataTables("库存表_Table1").GetValues("商品类别|商品编号|商品名称|规格型号|单位|期初库存数量|入库数量|出库数量|库存数量")
If DataTables("库存表").Find("商品编号 = \'" & dt("商品编号") & "\'") Is Nothing Then
For i As Integer = 0 To Vals.Count - 1
Dim dr As DataRow = DataTables("库存表").AddNew()
dr("商品类别") = Vals(i)(0)
dr("商品编号") = Vals(i)(1)
dr("商品名称") = Vals(i)(2)
dr("规格型号") = Vals(i)(3)
dr("单位") = Vals(i)(4)
dr("期初库存数量") = Vals(i)(5)
dr("入库数量") = Vals(i)(6)
dr("出库数量") = Vals(i)(7)
dr("库存数量") = Vals(i)(8)
End If
Next