A method and device for programming a cordless handpiece used for root canal treatment and having a first memory and a tool holder for a treatment tool are described. The method includes providing a first data volume having a plurality of data sets in a second memory separate from the first memory, each of the data sets comprising at least one parameter assigned to the cordless handpiece and/or to the treatment tool, selecting at least some of the data sets from the first data volume in the second memory, transmitting the selected data sets from the second memory to the first memory of the handpiece, and selecting a data set from the updated first memory for operation of the handpiece.