Basic question about repeaters and datasets

Hi,
Is there any way to connect a repeater to a dataset by code and not manually from the editor?
(I’m talking about connecting the repeater itself, not populating the elements inside the repeater).
Thanks,
J.D.