Select Case e.DataCol.name
Case "商品编号"
Dim dr As DataRow = DataTables("库存").Find("商品编号 = '" & e.OldValue & "'")
If dr Is Nothing Then
dr = DataTables("库存").AddNew()
dr("商品编号") = e.DataRow("商品编号")
dr("商品名称") = e.DataRow("商品名称")
dr("规格") = e.DataRow("规格")
Else
dr("商品编号") = e.DataRow("商品编号")
End If
Case "商品名称","规格"
Dim dr As DataRow = DataTables("库存").Find("商品编号 = '" & e.DataRow("商品编号") & "'")
If dr IsNot Nothing Then
dr(e.DataCol.Name) = e.DataRow(e.DataCol.Name)
End If
End Select
老师上面代码不能更新库存表数据