Solved

App Setting Data Key

Posted on 2012-04-11
3
252 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
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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now