25-03-20, 04:50 AM
عدل الكود ليكون كالتالي :
PHP كود :
'=========== اضافة الكمية ==============================
For M As Integer = 0 To DataGridView1.Rows.Count - 1
Dim NEW_QTY As Integer
NEW_QTY = Val(DataGridView1.Rows(M).Cells(7).Value) - Val(DataGridView1.Rows(M).Cells(4).Value)
Dim CMD_1 As New SqlClient.SqlCommand
CMD_1.Connection = sqlconn
CMD_1.CommandText = " UPDATE ITEM SET QTY =" & NEW_QTY & " WHERE ITEM_CODE = '" & DataGridView1.Rows(M).Cells(0).Value & "'"
CMD_1.ExecuteNonQuery()
Next
سبحان الله وبحمده سبحان الله العظيم و الحمد لله ولا اله الا الله والله اكبر
