Hi all,
here is my code.
Now i want to update the txtDiscount value if it is already exist,else it will go to insert a new data.
Now the problem is it will not going to update the value even already have the same txtDiscount value. The system will always go to the Insert() function. It will not go Updatefunction to update the value.
Is there any problem or mistake in my code?
Your help is appreciated. Thanks.
here is my code.
With DGVMargin
For i As Integer = 0 To .Rows.Count - 1
If txttype.Text = "NORMAL" Then
If txtDiscount.Text = .Rows(i).Cells("DiscountNormal").Value Then
decodeDiscount()
Updatefunction()
Exit For
Else
decodeDiscount()
Insert()
Exit For
End If
Next
End With
Now i want to update the txtDiscount value if it is already exist,else it will go to insert a new data.
Now the problem is it will not going to update the value even already have the same txtDiscount value. The system will always go to the Insert() function. It will not go Updatefunction to update the value.
Is there any problem or mistake in my code?
Your help is appreciated. Thanks.