System.Configuration.Configuration webconfig = WebConfigurationManager.OpenWebConfiguration("/WebService1") as System.Configuration.Configuration; webconfig.ConnectionStrings.ConnectionStrings.Clear(); webconfig.ConnectionStrings.ConnectionStrings.Add(new System.Configuration.ConnectionStringSettings("connection", string.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID={2};Password={3}", item.DataSource, item.InitialCatelog, item.Username, item.Password))); System.Configuration.ConfigurationSection section = webconfig.GetSection(webconfig.ConnectionStrings.SectionInformation.SectionName); section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider"); webconfig.Save(System.Configuration.ConfigurationSaveMode.Modified);
C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe
OpenWebConfiguration
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)