This is propably a very easy question.
But i cant fix it.
I try an update if @ID = column id, else insert all.
Only this one doesn’t work if i put it all in one sentence
Cmd.CommandText = "UPDATE Locatie SET (Longitude = @Longitude, Latitude = @Latitude, Timestamp = @Timestamp) WHERE ID=@ID IF @@ROWCOUNT=0 INSERT INTO Locatie VALUES (@ID, @Longitude, @Latitude, @Timestamp)"
This should work just fine
Although you are probably better off (for maintainability) using a stored procedure.