private void timer1_Tick(object sender, EventArgs e) {
// try
// {
BarcodeReader reader = new BarcodeReader();
Result result = reader.Decode((Bitmap)scanQRIMAGE.Image);
string decoded = result.ToString().Trim();
ID_text.Text = decoded;
if (decoded != null)
{
con.Open();
MySqlCommand coman = new MySqlCommand();
coman.Connection = con;
coman.CommandText = " select * from hopetestdb where id Like'%" + ID_text.Text + "%'";
MySqlDataReader dr = coman.ExecuteReader();
dr.Read();
if (dr.HasRows)
{
ID_text.Text = dr["id"].ToString();
tb_Fname.Text = dr["Firstname"].ToString();
tb_Lastname.Text = dr["Lastname"].ToString();
tb_Role.Text = dr["GymRole"].ToString();
byte[] img = ((byte[])dr["Photo"]);
MemoryStream ms = new MemoryStream(img);
IMAGEperson.Image = Image.FromStream(ms);
}
con.Close();
even it detect something this always happen and sometimes wrong data will appear result was null i check if i have wrong in the youtube that i watch but nothing wrong