Dim connection As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"
Dim conn As New SqlConnection(connection)
conn.Open()
Dim comm As String = "INSERT INTO RENT(CH_IN,CH_OUT)"
comm &= "VALUES(Convert(DateTime, '" & lblSeleceDate.Text & "', 103),"
comm &= "Convert(DateTime, '" & lblSeleceDate1.Text & "', 103))"
Dim command As New SqlCommand(comm, conn)
Try
command.ExecuteNonQuery()
Catch ex As Exception
Label1.Text = "ผิดพลาด"
End Try
conn.Close()