I have an object that I use to generate SQL statements. oDb.From
is set once, then metadata may add join(s) over time till we combine it all and pass it back.
So the question is, what # of times do I keep syntax oDb.From += ...
before I replace it with sbFrom.Append()
?
Is that # 3, 4, or 15 times?
Or is it really a length of content issue, and if so what is the magical number?
Read http://www.codinghorror.com/blog/archives/001218.html
The StringBuilder
class is designed for scenarios where you are constructing mammoth strings, and using normal string concatenation really would be too slow.
The chances are that for the sort of string lengths that you are dealing with it really wont make any difference at all - just use whatever you are most comfortable with.