newbie question: connection string handling

L

luke

Hi
I wonder are there any "professional ways" to handle the connection string
if you like to deploy to various servers from one application, apart from
hard code in the application. e.g. read connection from txt, ini file, or
from registry.

if we use hard code in the application, then maintenance will be a problem
and need to change from server to server. but if we use registry to
customize the connection on the fly, would there be any performance or
security problems?


thanks


luke
 
C

coolCoder

luke said:
Hi
I wonder are there any "professional ways" to handle the connection string
if you like to deploy to various servers from one application, apart from
hard code in the application. e.g. read connection from txt, ini file, or
from registry.

if we use hard code in the application, then maintenance will be a problem
and need to change from server to server. but if we use registry to
customize the connection on the fly, would there be any performance or
security problems?


thanks


luke

Hi luke,
1) Reading a connection string from outside a program wont
affect the performance until and unless you need to read connection
string very often.
2) If you are storing connection string any where on your
computer, then naturally security concerns rise. In this case your
password might be stolen in some or the other way if the connection
string is in plain text or some other simple format. A possible
workaround can be that you store it in encrypted format. But then if
you need to change the connection string you will need to store it in
the encrypted form. For this you may create a small application.
 
C

Cowboy \(Gregory A. Beamer\)

Many apps using same connection? Registry may make sense here.

To avoid multiple hits to the registry, cache the strings on startup.

DIFferent connections for different apps? Config file makes more sense. If
you need protection, you can encrypt the strings on the machine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top