06-07-24, 11:55 AM
المشكله الاولى هل اضفت كود البارامتر يللي موجوده في التحديث وهي @ProductBuyPrice و @ProductSalePrice و @ProductDate ؟
المشكله التانيه احذف السطر On Error Resume Next لتعرف المشكله في الكود
كود :
cm = New SqlCommand("update tblProduct set ProductQuantity = ProductQuantity + " & CInt(DataGridView1.Rows(i).Cells(7).Value.ToString) & ", ProductBuyPrice=@ProductBuyPrice ,ProductSalePrice=@ProductSalePrice ,ProductDate=@ProductDate where ProductID like '" & DataGridView1.Rows(i).Cells(1).Value.ToString & "'", cn)
cm.Parameters.AddWithValue("@ProductBuyPrice",252.44)
cm.Parameters.AddWithValue("@ProductSalePrice",674.11)
cm.Parameters.AddWithValue("@ProductDate ",CDate("2024-07-07"))المشكله التانيه احذف السطر On Error Resume Next لتعرف المشكله في الكود
