Need to generate it quickly? Taking a lot of time.

FranziskaNagel

New Member
Class1 CLS = new Class1();

DataTable dt = CLS.ShowalldataSerial(textBox4.Text);


for (int i = 0; i <= Convert.ToInt32(textBox1.Text); i++)

{

Serial = SRL.Rnd().ToString();

txt = "UserID" + dt.Rows[0][0] + "FirmName" + dt.Rows[0][1] + "OrderNo" + dt.Rows[0][2] + "BtachNo" + dt.Rows[0][3] + "Quantity" + dt.Rows[0][4] + "ProductName" + dt.Rows[0][5] + "SerialNo" + Serial;


dm.DM(txt, Color.FromName(comboBox1.SelectedItem.ToString()), Color.White).Save(root + "\\" + Serial + ".emf", System.Drawing.Imaging.ImageFormat.Emf);


}

MessageBox.Show("Records generated success ");




The problem that I am having with the above mentioned code is that it is taking a lot of time. Using this code, it took a minute to generate 10000 files matrix bar code. The point is that when I am using this code for 200000 in respective textcode it almost takes half an hour or more. Thereby I am looking for something that would help me generate code for 200000 and that too quickly. Can anyone help me with it?
 

Pavlos Sakoglou

Well-Known Member
C++ Student
Class1 CLS = new Class1();

DataTable dt = CLS.ShowalldataSerial(textBox4.Text);


for (int i = 0; i <= Convert.ToInt32(textBox1.Text); i++)

{

Serial = SRL.Rnd().ToString();

txt = "UserID" + dt.Rows[0][0] + "FirmName" + dt.Rows[0][1] + "OrderNo" + dt.Rows[0][2] + "BtachNo" + dt.Rows[0][3] + "Quantity" + dt.Rows[0][4] + "ProductName" + dt.Rows[0][5] + "SerialNo" + Serial;


dm.DM(txt, Color.FromName(comboBox1.SelectedItem.ToString()), Color.White).Save(root + "\\" + Serial + ".emf", System.Drawing.Imaging.ImageFormat.Emf);


}

MessageBox.Show("Records generated success ");




The problem that I am having with the above mentioned code is that it is taking a lot of time. Using this code, it took a minute to generate 10000 files matrix bar code. The point is that when I am using this code for 200000 in respective textcode it almost takes half an hour or more. Thereby I am looking for something that would help me generate code for 200000 and that too quickly. Can anyone help me with it?
Where is this code from?
You might want to post in another category in the forum for that:
https://www.quantnet.com/forum/computing.24/
 

pingu

Well-Known Member
is this C#? Managed C++?

This System.Drawing.Imaging.ImageFormat.Emf and MessageBox.Show, look really suspicious
 
Top