I am not in the least surprised.
Look at what you are doing: It boils down to:
dat1 = DateTime.Parse("select joindate from employee where emp_id=1")
Which (predictably enough) is not a date, or even vaguely like a date!
You need to read the data from the database itself:
Using con As New SqlConnection(strConnect)
con.Open()
Using com As New SqlCommand("SELECT joindate FROM employee WHERE empi_id=@ID", con)
com.Parameters.AddWithValue("@ID", TextBox1.Text)
Using reader As SqlDataReader = com.ExecuteReader()
While reader.Read()
dat1 = DirectCast(reader("joindate"), DateTime)
End While
End Using
End Using
End Using
Please note that this uses a Parametrized query - you should use these at all times, as your original code (had it accessed the DB) would have left you wide open to an SQL Injection Attack, which could damage or destroy your database.