I assume you're using CB Query Field and its Query Validation for this? It just validates. It has no functionality to fill out fields.
Can you better describe what you're trying to do exactly and where? Is this just meant to display on profile? If so I'd just use a Query Field and you can query for that information as follows.
Query:
Code:
SELECT CONCAT( `firstname`, ' ', `lastname` ) FROM `#__comprofiler` WHERE `cb_num_socio` = '[cb_num_socio]'
The above should work during registration as well if you combine it with CB Core Fields Ajax and its "Update On" feature. You'd have it "Update On" the cb_num_socio field so its display refreshes during profile edit and registration when that fields value changes.
If you need it stored in the database you have a couple of different options. You could use CB Auto Actions and a Query action to push that information into the database.
You could also use something like Query Auto Complete on a Text field to give a dropdown selection of names matching that field. Example as follows.
Integrations > CB Query Field > Auto Complete
Query Auto Complete: Enable
Query:
Code:
SELECT CONCAT( `firstname`, ' ', `lastname` ) FROM `#__comprofiler` WHERE `cb_num_socio` = '[value]'