Private Sub cmdOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOut.Click
If txtempno.Text = String.Empty Then
MsgBox("Insert first your employee number.", vbExclamation)
lblIN.Text = ""
lblOUT.Text = ""
Exit Sub
End If
Dim ssql As String
ssql = "UPDATE tbl_timerec SET TimeOUT=@lblOUT WHERE EmpNo=@txtempno"
Dim com As New SqlCeCommand
Using con As SqlCeConnection = New SqlCeConnection("Data Source=" & My.Settings.PATS)
Try
lblOUT.Text = lbltime.Text
With com
con.Open()
com.CommandType = CommandType.Text
com.CommandText = ssql
com.Connection = con
com.Parameters.AddWithValue("@lblOUT", lblOUT.Text)
com.Parameters.AddWithValue("@txtempno", txtempno.Text)
End With
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly, "Error!")
Finally
com.ExecuteNonQuery()
Dim lv As ListViewItem = ListView1.Items.Add(lblIN.Text)
lv.SubItems.Add(lblOUT.Text)
MsgBox("Successfully Logged OUT!", vbInformation, "Success!")
lblIN.Text = ""
lblOUT.Text = ""
End Try
End Using
End Sub
My problem is when i click log out. it goes to the next row of the listview at the column of Timeout.. here's some picture :-/