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. i had tried basic sql query but seems to be not working.
Please Help.
code i am using for saving and assigning Tags to employees is as follows :
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();