I am trying to add new list item to settings.settings file. I have modified my settings.settings file as below
and on button click i have the following code:
private void button7_Click(object sender, EventArgs e)
{
string tempConString = "server='.\sqlexpress';database='somedatabasename';Trusted_Connection=Yes;";
Properties.Settings.Default.connectionString.Add(tempConString);
Properties.Settings.Default.Save();
}
i am getting NullReferenceException with message Object reference not set to an instance of an object.
I want to save multiple strings to Properties.Settings.Default.connectionString