Solved

App Setting Data Key

Posted on 2012-04-11
3
257 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…

740 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