datatool apparently doesn't protect its internals enough to be used in this context. You can hide the switching in \noalign
as below. I also removed the center environment as it has no effect on longtable.
\documentclass{article}\usepackage{datatool,longtable}\begin{document}\DTLsetseparator{;} \DTLloaddb{kundt2}{kundt2.csv}\begin{longtable}{|c|c|c|}\caption[De berekende bronsterkte van de buis]{De berekende bronsterkte van de buis} \label{tbl:kundt2} \\\hline\endfirsthead\endhead\endfoot\endlastfoot\noalign\bgroup\DTLforeach{kundt2}{\1=1, \2=2, \3=3}{\egroup\ifthenelse{\value{DTLrowi}>0}{\1 & \2 & \3 \\ \hline }{}\noalign\bgroup}\egroup\end{longtable}\end{document}