|
-
May 7th, 2017, 09:14 PM
#3
Re: when generate 10000 matrix bar code it take too much time How to make generating
Is it my imagination or are you not even using 'i' inside that loop? Should you maybe be using 'dt.Rows[i]' rather than 'dt.Rows[0]'? In keeping with si's adavice, you should also be getting that DataRow only once and assigning it to a variable, then using the variable multiple times. You should basically NEVER use a complex expression multiple times if you know that it will yield the same result every time. Use the expression once, assign the result to a variable and then reuse the variable.
Anyway, once you've considered si's advice and cleaned up your code, you might also look at implementing some parallelism, e.g. calling Parallel.For instead of using a standard 'for' loop.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|