14-04-17, 09:16 PM
(آخر تعديل لهذه المشاركة : 15-04-17, 05:13 PM {2} بواسطة نبيل كونكت.)
PHP كود :
Private Sub txtlabel_KeyDown(sender As Object, e As KeyEventArgs) Handles txtlabel.KeyDown
Try
If e.KeyCode = Keys.Enter Then
'get product infos
cmd = New OleDb.OleDbCommand("select id, PRICE from tab_pro where label = " & txtlabel.Text, con)
con.Open()
Dim dr As OleDb.OleDbDataReader = cmd.ExecuteReader
dr.Read()
If dr.HasRows Then
txtid.Text = dr(0)
txtprice.Text = dr(1)
txtqty.Focus()
Else
MsgBox("تحقق من المنتج", MsgBoxStyle.Exclamation, "تنبيه")
clear()
End If
dr.Close()
End If
Catch ex As Exception
Exit Sub
Finally
con.Close()
End Try
End Sub