Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connection String (not in config file)
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01012624
Message ID:
01012662
Views:
16
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?
Previous
Reply
Map
View

Click here to load this message in the networking platform