问题
for my rfid card value was
the case is when i tap why the text was not empty ? and when i tap the second card it only give me 1 digit
card2 tap
the code i use
private void textEdit1_KeyPress(object sender, KeyPressEventArgs e)
{
if (this.textEdit1.Text.Length == 10)
{
getcodestudent();
this.textEdit1.Text = "";
}
}
for getcodestudent()
public void getcodestudent()
{
SqlDataAdapter adapter = new SqlDataAdapter();
SqlParameter para2 = new SqlParameter();
try
{
ds6.Clear();
dt6.Clear();
command6.Connection = myConnection;
command6.CommandText = //..//;
adapter.SelectCommand = command6;
adapter.Fill(ds6);
adapter.Fill(dt6);
}
catch (Exception ex)
{
MessageBox.Show("error" + ex);
}
if (dt6.Rows.Count == 1)
{
member = ds6.Tables[0].Rows[0][0].ToString();
MessageBox.Show(member);
}
but if i delete the text after tapping with card with backspace
and then tap again with card, it works perfectly fine on running getcodestudent();
this.textEdit1.Text = "";
来源:https://stackoverflow.com/questions/39652317/when-tap-only-get-1-digit