22-04-17, 02:49 AM
تفضل التعديل
PHP كود :
Private Sub txtlabel_KeyDown(sender As Object, e As KeyEventArgs) Handles txtlabel.KeyDown
If e.KeyCode = Keys.Enter Then
Try
'get product infos
Dim da As New OleDb.OleDbDataAdapter("SELECT [id], [PRICE] FROM [tab_pro] WHERE [label] = @lab", con)
da.SelectCommand.Parameters.AddWithValue("@lab", txtlabel.Text)
Dim dt As New DataTable
If da.Fill(dt) > 0 Then
Dim r As DataRow = dt.Rows(0)
txtid.Text = r("id")
txtprice.Text = r("PRICE")
txtqty.Select()
Else
MsgBox("تحقق من المنتج", MsgBoxStyle.Exclamation, "تنبيه")
clear()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
