c# change App.config files Connection String
using System.Configuration;
string newConnectionString1 = "Data Source=" + txtServer.Text + ";Initial Catalog=Garments;Persist Security Info=True;User ID=" + txtLogin.Text +";Password="+ txtPass.Text;
string newConnectionString2 = "Data Source=" + txtServer.Text + ";Initial Catalog=Garments;Persist Security Info=True;User ID=" + txtLogin.Text + ";Password=" + txtPass.Text;
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
config.ConnectionStrings.ConnectionStrings["Germens_production.Properties.Settings.GermensConnectionString"].ConnectionString = newConnectionString1;
config.ConnectionStrings.ConnectionStrings["Germens_production.Properties.Settings.GarmentsConnectionString"].ConnectionString = newConnectionString2;
config.Save(ConfigurationSaveMode.Modified, true);
ConfigurationManager.RefreshSection(config.ConnectionStrings.SectionInformation.SectionName);