You should use the correct data types for storing the data in sql but this will get you going for now
just change the strConnectionString for your own.
Dim sDateFrom As String = Nothing
Dim dFrom As DateTime
Dim dTo As DateTime
Dim sDateTo As String = lblTime.Text
Dim connection As New SqlConnection(strConnectionString)
Using connection
Dim command As SqlCommand = New SqlCommand("select top 1 TimeIN from TimeLog;", connection)
connection.Open()
Dim reader As SqlDataReader = command.ExecuteReader()
If reader.HasRows Then
Do While reader.Read()
sDateFrom = reader.GetValue(0)
Loop
End If
End Using
sDateFrom = DateTime.TryParse(sDateFrom, dFrom)
sDateTo = DateTime.TryParse(sDateTo, dTo)
Dim TS As TimeSpan = dFrom - dTo
Dim hour As Integer = TS.Hours
Dim mins As Integer = TS.Minutes
Dim secs As Integer = TS.Seconds
Dim timeDiff As String = ((hour.ToString("00") & ":") + mins.ToString("00") & ":") + secs.ToString("00")
txttotal.Text = timeDiff