Try
For Each item As ListViewItem In lsvproduct.Items
Dim Conn As New SqlConnection(strCon)
Dim com As New SqlCommand
Conn.Open()
Dim a As Integer = Convert.ToInt32(item.SubItems(2).Text)
Dim sql As String = " UPDATE STOCK SET QUANTITY=[QUANTITY]- '" & a & "' WHERE PRODUCT_ID='" & item.Text & "' "
With com
.Connection = Conn
.CommandType = CommandType.Text
.CommandText = sql
End With
com.ExecuteNonQuery()
Next
Catch ex As Exception
MessageBox.Show("ERROR.")
End Try