R
Ryan McLean
Hello everyone, I have a question for you. If I need to print 20,000
lines to a file which option is the most efficient?
(these are generated inside a datareader loop)
#1 Concatenate the data into a string variable, then write file at the
end of the loop (99.9% sure this is not it)
#2 Append the data into stringbuilder variable, then write file at the
end of the loop
#3 Append the data into stringbuilder variable, writing to the file
ever 500 or so records
#4 Don't use any variable, simply write directly to the file in every
iteration (99.9% sure this is not it either)
Thanks, I really appreciate your help. Have a great day!
Ryan
lines to a file which option is the most efficient?
(these are generated inside a datareader loop)
#1 Concatenate the data into a string variable, then write file at the
end of the loop (99.9% sure this is not it)
#2 Append the data into stringbuilder variable, then write file at the
end of the loop
#3 Append the data into stringbuilder variable, writing to the file
ever 500 or so records
#4 Don't use any variable, simply write directly to the file in every
iteration (99.9% sure this is not it either)
Thanks, I really appreciate your help. Have a great day!
Ryan