In this line:
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;
, a big part is constant in the loop:
"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"
By moving the constant part outside of the loop, you should save some time.
Quote:
root + "\\" + Serial + ".emf"
Are you saving each bar code in a separate file in root of hard drive ?
Optimization is a job by itself, and to be efficient, one must know the details of what you do in order to evaluate the other possibilities to get more efficient.