//method for OK button and to add to database private void btnOK_Click(object sender, EventArgs e) { string name = txtSupName.Text.ToString(); //take input int i = SuppliersDB.AddNewSupplier(name.ToUpper()); //make input all uppercase KeyValuePair <string, int> val = new KeyValuePair <string, int>(name.ToUpper(), i); //create key value pairs SuppliersDB.Suppliers.Add(val); //add value to database MessageBox.Show("Created new supplier.", "Success"); //popup for success message this.Close(); }