My thoughts are that it really doesn't matter (from a security point of view). If someone has their own code, then you are equally screwed anyway. If someone does not have your code, then it does not matter because he cannot execute it without code for him to be a problem (if you have remote code execution vulnerabilities, you have more problems than connection strings).
From a design point of view, I would probably use a private constant.
Matthew scharley
source share