Solved

App Setting Data Key

Posted on 2012-04-11
3
258 Views
Last Modified: 2012-04-12
Is there a way to save my data source keys in a text file list which the Web.Config reads?

If not...what is the best way of adding an appsetting data source name like the one below without having to kick anyone off of the server?

<add name="myGG" connectionString="Data Source=myDataBase;Initial Catalog=myGG;Integrated Security=True" providerName="System.Data.SqlClient" />
0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Expert Comment

by:angus_young_acdc
ID: 37833290
Why not have different keys but have different names?  

<add name="myGG1" connectionString="Data Source=myDataBase;Initial Catalog=myGG;Integrated Security=True" providerName="System.Data.SqlClient" />
<add name="myGG2" connectionString="Data Source=myDataBase;Initial Catalog=myGG;Integrated Security=True" providerName="System.Data.SqlClient" />
<add name="myGG3" connectionString="Data Source=myDataBase;Initial Catalog=myGG;Integrated Security=True" providerName="System.Data.SqlClient" />

^ for example.

Then have another section where you configure which to select
<add key="MyConnectionToPick" value="myGG2"/>

So in your code instead of stating you want specifically "myGG2" you say you want the connection stated in MyConnectionToPick.
0
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 500 total points
ID: 37834151
0
 

Author Closing Comment

by:lrbrister
ID: 37837597
Please watch for follow-up questions
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question