This has always been an interesting one to answer. It all depends on your current situation and needs.
- Will you have to change the
connection string post deploy?
- Security considerations -> Someone
might be able to get access to your
database from the stored credential.
(How much permissions does that
credential have?, etc..)
If you want the flexibility to change connection strings easily post deploy, that maybe app.config might be easiest option.
If security is a concern, then you could look at two things.
- Locking down permission on that
credential (only give the minimum
required rights for you app to work)
- Encrypting your connection string.
(Have a look at MS Enterprise
Library, from memory they will store
the connection string encrypted and
decrypt for you)
- Storing connection string in
registry
- Encrypting and storing connection
string in registry (If it is a major concern. It about making it harder for the hacker.)