Dear All,
I am doing an application with DGV to get the user input.
There are five column and n number of rows which user can add, now i want to validate if the user enters 0 (zero quantity) in a particular column in
n number of rows before inserting into access db
Here my code but its not checking entire number of rows even i looped DGV, if 1st row is zero and 2,3,4... rows is 1 or > than zero then its validating and if 1st row is 1 or > than zero and 2,3,4... rows is zero then its going to else part.
I am doing an application with DGV to get the user input.
There are five column and n number of rows which user can add, now i want to validate if the user enters 0 (zero quantity) in a particular column in
n number of rows before inserting into access db
Here my code but its not checking entire number of rows even i looped DGV, if 1st row is zero and 2,3,4... rows is 1 or > than zero then its validating and if 1st row is 1 or > than zero and 2,3,4... rows is zero then its going to else part.
Code:
For Each item As DataGridViewRow In Me.DataGridView2.Rows
If item.Cells(3).Value = 0 Then
MsgBox("Zero Qty is not Allowed")
Exit For
Else
' Insert into table Qry
End If
Next