I have this code but when i run it,it didn't execute the query,can someone help me?
If timenow <= time2 Then
cmd = New SqlCommand("INSERT INTO attendance(timeIn,date,tid,late)VALUES('" & timein.Text & "','" & datein.Text & "','" & TidLabel1.Text & "',0)", cn)
MsgBox("Time out record success!")
ElseIf timenow < time1 Then
MsgBox("your late!")
cmd = New SqlCommand("INSERT INTO attendance(timeIn,date,tid,absent)VALUES('" & timein.Text & "','" & datein.Text & "','" & TidLabel1.Text & "',1)", cn)
MsgBox("Time in record success!")
cmd.ExecuteScalar()
End If