Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set connection string using config file
Message
 
 
To
12/09/2008 05:01:56
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01303511
Message ID:
01347070
Views:
24
>>>If you want to switch between different databases, the connectionstring itself is the place for that.
>>>Your tableadapters should always point to the same connectionstring definition of your app.config.
>>>To switch to a different database, just change the connectionstring in your app.config.
>>
>>There has to be a better way if you want to access different databases with the same TableAdapters.
>
>well, what's your definition of "better way" in this case?
>
>If you want to connect to different databases, you will have to change the connectionstring somehow and you will want to change it in one single place only. The config file is that single place and it is very easy to change the connectionstring because its XML (text) only, unless its not encrypted.

I was trying to help someone from another forum. The question he has is - he has two databases - Live and Archive. In the Page he wants to give a user a choice to pull data either from Live or from Archive. So, the question is how to switch the database in the DataAdapters.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform