OpenConn()
For Each li As Windows.Forms.ListViewItem In ListView1.Items
With OleDa
.UpdateCommand = New OleDb.OleDbCommand()
.UpdateCommand.CommandText = "UPDATE [Inventry] SET [CODE] = @CODE , [ITEM] = @ITEM , [QTY] = val(QTY) - @QTY , [SPRICE] = @SPRICE , [PPRICE] = @PPRICE WHERE (CODE = ?)"
.UpdateCommand.Connection = Con
.UpdateCommand.Parameters.Add("@CODE", OleDb.OleDbType.VarWChar, 50, "CODE").Value = li.SubItems(1)
.UpdateCommand.Parameters.Add("@ITEM", OleDb.OleDbType.VarWChar, 50, "ITEM").Value = li.SubItems(2).Text
.UpdateCommand.Parameters.Add("@QTY", OleDb.OleDbType.VarWChar, 50, "QTY").Value = li.SubItems(3).Text
.UpdateCommand.Parameters.Add("@SPRICE", OleDb.OleDbType.VarWChar, 50, "SPRICE").Value = "@SPRICE"
.UpdateCommand.Parameters.Add("@PPRICE", OleDb.OleDbType.VarWChar, 50, "PPRICE").Value = "@PPRICE"
.UpdateCommand.ExecuteNonQuery()
End With
Next
CloseConn()
hhm_pro992 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.