private void btnUpload_Click(object sender, EventArgs e) { //Check if file is selected if (File != null) { //Check which RadioButton is selected if (rbUser.Checked) { Import.InsertUsers(); } else if (rbIncident.Checked) { Import.InsertIncidents(); } else { MessageBox.Show("Please select a datatable to insert.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("Please select a file.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }