How to Execute a SQL query while a Data Reader is opened ? : I'd like to know how can I execute a sql Query while a data reader is opened.

code : 

          using (SqlDataReader reader = command.ExecuteReader())
                        {
                            while (reader.Read())
                            {
                                Console.WriteLine(String.Format(" Id Bracelet :{0} | Id Client: {1} | First Name: {2} | Last Name: {3}", reader["IdBracelet"], reader["IdClient"], reader["FirstName"], reader["LastName"]));
                                al.Add(reader["IdBracelet"]);
                            }
                                        while (true){
    Y.Function();
                                        string strQueryInsert = "Insert into TableZ(xxx, xx, xxxx, xxxxx, xxxxxx) values (@xxx, @xx, @xxxx, @xxxxx, @xxxxxx)";
                                        SqlCommand cmd = new SqlCommand(strQueryInsert, connection);
                                        cmd.Parameters.AddWithValue("@xxx", xxx);
                                        cmd.Parameters.AddWithValue("@xx", xx);
                                        cmd.Parameters.AddWithValue("@xxxx", xxxx);
                                        cmd.Parameters.AddWithValue("@xxxxx", xxxxx);
                                        cmd.Parameters.AddWithValue("@xxxxxx", xxxxxx);
                                        cmd.ExecuteNonQuery();
                                        Thread.Sleep(5000);
    
                                        
                              }                 
    
     
                      }



I get this error : System.InvalidOperationException: 'There is already an open DataReader associated with this Command which must be closed first.'

I need the query to be executed within the reader because I store the values that the reader return in a List and then use those values.

If anybody knows how to fix it , might be very helpful , thanks 