Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connection String (not in config file)
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01012624
Message ID:
01012662
Vues:
17
Hi Roger,

>I am trying to pass into my objects a connection string rather than having the framework automatically find the connection string in the app, web, or machine.config files. I work with many database connections (100+) and don't want to store them all in the config file.

Well if you store the data in a database you'll first need at least one connectionstring to connect to that first database. Maybe you can store just that in a config file and get the others as needed later.

FWIW, I would still consider using a configuration file for this unless the connection strings are getting added and removed frequently. Just stick the connection strings into a separate configuration section. With some custom code you can encrypt the stuff even:

http://www.west-wind.com/presentations/configurationclass/configurationclass.asp

and then retrieve the values as strings.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform