No action may be instituted or maintained in the right of any association by a member or stockholder unless he alleges in his complaint that he was a member or registered stockholder when any part of the transaction of which he complains took place, or that his stock thereafter devolved upon him by operation of law from a stockholder at such time.
SDCL 47-16-35