Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic Connection Strings
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01186536
Message ID:
01186825
Views:
19
Darren,

>I need to dynamically modify the connection string used by some of my business objects (DataAccess classes) based on some input from the user ie the physical location of the data (these objects will be using OleDb providers).
>
>How can i go about doing this? My initial thoughts were to dynamically modify the connection strings contained within the app.config file. Kevin, perhaps you could point me in the right direction here. I see all the methods etc for reading data contained within the app.config, but how do you write this data?? Specifically the database connection keys.
>
>I was looking into the mmAppConfiruation classes but could not see how to get this to work (even creating a subclass) as the key names ie \databaseKey\Connection is not a valid class field name.
>
>Or is there a better way to go about doing this?

Do you really need to persist the settings or do you just need to change them dynamically at run time?

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform