我的rfid卡值是
案例是当我点击为什么文本不为空?当我点击第二张卡时,它只给我一位数
card2点击
我使用的代码
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);
}
但是,如果我使用卡片backspace
点击后删除文字,然后再使用卡片再次点击,那么在运行getcodestudent();
this.textEdit1.Text = "";