private void AddButton_Click(object sender, EventArgs e) { if (NameTextBox.Text == "" || PriceTextBox.Text == "") { MessageBox.Show("Please, enter at least the scan name and price."); } else { int r = controllerObj.A_AddScan(NameTextBox.Text.ToString(), Convert.ToInt32(PriceTextBox.Text.ToString())); if (r > 0) { MessageBox.Show("Scan added successfully."); DataTable dt1 = controllerObj.SelectScanIDsNames(); ScansComboBox.DataSource = dt1; ScansComboBox.DisplayMember = "Name"; ScansComboBox.ValueMember = "SID"; } else { MessageBox.Show("Error in adding scan."); } } }