private void savelist_Click(object sender, RoutedEventArgs e) { SqliteDataAccess.DelList(listname.Text); try { if (proc1.Text.ToString() != "") { add_proc_to_cbox(proc1.Text.ToString()); } } catch (Exception) { } try { if (proc2.Text.ToString() != "") { add_proc_to_cbox(proc2.Text.ToString()); } } catch (Exception) { } try { if (proc3.Text.ToString() != "") { add_proc_to_cbox(proc3.Text.ToString()); } } catch (Exception) { } try { if (proc4.Text.ToString() != "") { add_proc_to_cbox(proc4.Text.ToString()); } } catch (Exception) { } try { if (proc5.Text.ToString() != "") { add_proc_to_cbox(proc5.Text.ToString()); } } catch (Exception) { } PM = SqliteDataAccess.LoadProcs(); try { foreach (var x in wholelist.Items) { SqliteDataAccess.AddList(x.ToString(), listname.Text, proc1.Text, proc2.Text, proc3.Text, proc4.Text, proc5.Text); } } catch (Exception x) { MessageBox.Show(x.ToString()); } }