private void txtItems_TextChanged(object sender, EventArgs e)
{
try
{
MySqlCommand com = new MySqlCommand();
MySqlDataReader read;
com.CommandText = "SELECT * FROM Inventory where ProductID ='" + txtbCode.Text + "'";
com.Connection = MySQLConnection.con;
MySQLConnection.con.Open();
read = com.ExecuteReader();
while (read.Read())
{
txtCatogery.Text = read["Catogery"].ToString();
txtDiscriptions.Text = read["Description"].ToString();
txtQTY.Text = read["QTY"].ToString();
txtPrice.Text = read["Price"].ToString();
}
//Rest of code
}
}
TextBoxes にバーコードを入力txtbCode
すると、db から値が取得されますが、バーコード付きの製品がある場合は1234
56 を入力し続けます (123456) そのバーコード付きの製品はありませんが、テキストボックスの値は更新されず、保持されます1234 について読み取られる値。
どうすればそれを達成できますか?