private void buttonCreate_Click(object sender, EventArgs e) { try { if (string.IsNullOrWhiteSpace(textBoxSignature.Text) || string.IsNullOrWhiteSpace(textBoxName.Text)) // Checking if all textboxes are filled { MessageBox.Show("You have to fill everything !"); } else { connectionMySql connectionDB = new connectionMySql(); connectionDB.createNewSignature(textBoxName.Text, textBoxSignature.Text); // create the new signature with infos in textboxes MessageBox.Show("New signature added !"); textBoxName.Text = null; textBoxSignature.Text = null; } } catch (Exception er) { MessageBox.Show(er.ToString()); } }