Problems with While in C #

0

I have a problem with my code, I have a for to do label printing according to the amount typed in camo txt.volumes.text, but when I type more than 1 volume while it goes out of the loop and only print 1 tag. Ex if I type 2 or more tags in the txt_volumes.Text field, while I only print 1 tag instead of 2.

Please someone please help me .. Thanks

Follow my code

            conex.Open();
            SqlDataReader ler = pedidos1.ExecuteReader();
            for (int i = 0; i < Convert.ToInt32(txt_volumes.Text); i++)
            {
               while (ler.Read())
                {
                    npedido.Add(ler[0].ToString());
                    etqpedido.Add("CLIENTE :" + ler[1].ToString());
                    etqpedido1.Add("TRANSP. :" + ler[2].ToString());
                    etqpedido2.Add("VOL. :" + txt_volumes.Text.ToString());
                }
                Print_EtqConf.Print();
                npedido.Clear();
                etqpedido.Clear();
                etqpedido1.Clear();
                etqpedido2.Clear();
            }
            conex.Close();
    
asked by anonymous 29.03.2018 / 16:18

0 answers