Find Value from Table
Dear Developers
SQL, Table1 has data as following
Code------product
1-----------Mango
2-----------Potato
3-----------Orange
Datagridview has THREE columns as
Code----product-------qty
I have following codes
If code not found then msgbox appears and cursor moves to NEXT COLUMN.
that works fine.
But I want.....
When code not found then cursor MUST NOT GO TO NEXT COLUMN.
Should I change code or choose some other datagridview event?
Please help
Dear Developers
SQL, Table1 has data as following
Code------product
1-----------Mango
2-----------Potato
3-----------Orange
Datagridview has THREE columns as
Code----product-------qty
I have following codes
VB.NET:
str3 = "SELECT product FROM table where code =" & Val(DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells(0).Value)
dt3 = GetTable3(str3)
If dt3.Rows.Count > 0 Then
DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells(1).Value = (IIf(IsDBNull(dt3.Rows(0).Item("product")), "", dt3.Rows(0).Item("product")))
Else
MsgBox("Code Not Found", MsgBoxStyle.Information)
End If
If code not found then msgbox appears and cursor moves to NEXT COLUMN.
that works fine.
But I want.....
When code not found then cursor MUST NOT GO TO NEXT COLUMN.
Should I change code or choose some other datagridview event?
Please help