I am try to read my barcode with a barcode reader.
Curiosly when I shoot on my barcode product its try to filter and suddently its stops and says this product doesnt exit. Its reads only the number 5 and cant continue to read the whole barcode.
private void txtCodProduct_KeyUp(object sender, KeyEventArgs e)
{
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test\App_Datas\test1.mdb;Persist Security Info=False";
OleDbConnection sqlCon = new OleDbConnection(connectionString);
sqlCon.Open();
string commandString = "select * from product where cod='" + txtCodProduct.Text + "'";
OleDbCommand sqlCmd = new OleDbCommand(commandString, sqlCon);
OleDbDataReader read = sqlCmd.ExecuteReader();
if (read.HasRows)
{
while (read.Read())
{
date.Text = read["date"].ToString();
product.Text = read["product"].ToString();
}
}
else
{
MessageBox.Show("this codproduct " + CodProduct.Text + " doesnt exist.");
}
read.Close();
sqlCon.Close();