Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
ServerManager mgr = new ServerManager();

foreach (Site s in mgr.Sites)
{


foreach (Application app in s.Applications)
{

foreach (VirtualDirectory virtDir in app.VirtualDirectories)
{



System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(virtDir.Path);

config.ConnectionStrings.ConnectionStrings["testEntities"].ConnectionString = "server=test;database=test;user id=test;password=test";

config.Save();

ConfigurationManager.RefreshSection("connectionStrings");


}
}
Posted
Updated 24-Jul-15 3:48am
v3
Comments
[no name] 24-Jul-15 10:07am    
Maybe one of these updates you can format your code so that it's readable. And you might want to consider updating your posting with an actual question and/or description of some sort of a problem with your code. As it is now, this is just a code dump.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900