将RFID保存到SQL数据库中的次数 [英] Save RFID into SQL database number of times
本文介绍了将RFID保存到SQL数据库中的次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i我正在尝试建立员工出勤系统并成功地为员工分配TAGS。现在我想计算员工的进/出时间和TAG交换了他/她的TAG而没有向最终用户显示任何数据。
请帮助。
代码我用于保存和为员工分配标签如下:
我尝试过:
Hi,
i am trying to build Employee Attendance system and was successful in assigning TAGS to employees.now i want to calculate in/out timings of employees and which TAG swapped His/Her TAG without displaying any data to end user.
Please Help.
code i am using for saving and assigning Tags to employees is as follows :
What I have tried:
SqlConnection con = new SqlConnection(str);
con.Open();
SqlCommand cmd = new SqlCommand("insert into EmpTable(TagID,Firstname,Lastname,Title) values (@TagID,@Firstname,@Lastname,@Title)", con);
// cmd.Parameters.AddWithValue("@EmpID", txtempid.Text);
cmd.Parameters.AddWithValue("@TagID", txttagid.Text);
cmd.Parameters.AddWithValue("@Firstname", txtfirstname.Text);
cmd.Parameters.AddWithValue("@Lastname", txtlastname.Text);
cmd.Parameters.AddWithValue("@Title", txttitle.Text);
cmd.ExecuteNonQuery();
MessageBox.Show("Data Saved.");
con.Close();
推荐答案
添加参数
和值
命令
Addparamter
andvalue
to the command
cmd.CommandText = "insert into sample(RFID) values (@RFID)";
cmd.Parameters.AddWithValue("@RFID", yourRFIDValue); // add this line
这篇关于将RFID保存到SQL数据库中的次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文