I want to make common connection string for database

  • Thread starter Thread starter Alex Smith
  • Start date Start date
A

Alex Smith

Hi Friends

I want to make common connection string for database. I can not use Web
config file, so please give idea excluding web.config file.

Thanks.

Alex
 
Hi,

1) You can serialize a string into a file using the XML format so you can
access externally, everytime the app runs you deserialize the file with the
content.

2) You can save it to a file, it can be encrypted if you use a CryptoStream,
the problem with this is that you can not modify externally.

3) You can hardcoded on your code as a constant

4) You can create a service that publishes data, one of those can be the
connection string, this will be a usuful way to share across applications and
they will be using always the latest one.

5) If you don't want to create a service it can be a component installed on
the GAC, the problem is that it will work only for that machine.

Hope this helps
Salva
 
Back
Top