Solved

App Setting Data Key

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 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

12 Experts available now in Live!

Get 1:1 Help Now