// Add a new connection string to the app.config and save it Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); ConnectionStringSettings cs = new ConnectionStringSettings("MyDB", "Data Source=localhost;Initial Catalog=MyDatabase;Integrated Security=True", "System.Data.SqlClient"); config.ConnectionStrings.ConnectionStrings.Add(cs); config.Save(ConfigurationSaveMode.Modified);
// Add a new user setting and save it Properties.Settings.Default.MySetting = "Hello World"; Properties.Settings.Default.Save();Package library: No additional package needed.