Hello! Do not scold strictly. I have such a problem from mysql database pulling out a cell with a specific id. Like this.
public ArrayList checkOnFilling(string id) { ArrayList checkFiling = new ArrayList(); using (MySqlConnection myConnection = new MySqlConnection(myConnectionString)) { try { myConnection.Open(); string CommandText =String.Format("SELECT id_voprosGos FROM students where id = {0} ", Convert.ToInt32(id)); MySqlCommand myCommand = new MySqlCommand(CommandText, myConnection); MySqlDataReader MyDataReader; MyDataReader = myCommand.ExecuteReader(); if (MyDataReader.HasRows) foreach (DbDataRecord result in MyDataReader) checkFiling.Add(result); MyDataReader.Close(); return checkFiling; } catch (System.Exception ex) { //MessageBox.Show(ex.Message); return null; } finally { myConnection.Close(); } } } I perform the check as follows.
private void FormFolder_Load(object sender, EventArgs e) { this.Text = Program.namePath; dl.createFolserStudent(Program.namePath); ArrayList checkOnFilling = dl.checkOnFilling(Program.id); if(checkOnFilling == null) { MessageBox.Show("У студента + " + Program.namePath + " не создан первый прокол "); radioButton2.Enabled = false; } else { MessageBox.Show("У студента + " + Program.namePath + " уже создан первый потакол "); radioButton2.Enabled = true; } } But my query still returns one record, regardless of whether the cell is empty or not. 
allStudentstudents is being filled, and with checking forMyDataReader.HasRows, i.e. without data, the list will remain empty. But in the second block nothing is clear whatdl.checkOnFilling(Program.id);? Offer wangovat? - Bulsondlhas two methods: createFolserStudent () and checkOnFilling (), but what such a dl is is not clear. - Bulson