Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 800
  • Last Modified:

c# how do i re-initialize qBuilder01 of type StringBuilder?

how do i re-initialize qBuilder01 of type StringBuilder?
 initially i declared StringBuilder qBuilder01 = new StringBuilder().
qBuilder01.Append(xNode.InnerText);
command.CommandText = qBuilder01.ToString();
..................

i want to re-use qBuilder01after i am done with first query.

thanks
0
jgordin
Asked:
jgordin
3 Solutions
 
tpwellsCommented:
qBuilder01.Remove(0, qBuilder01.Length)

Will remove everything from the builder and have it ready for more.
0
 
active_agentCommented:
qBuilder01.Length = 0

Will clear the StringBuilder.

0
 
Bob LearnedCommented:
Just create a new StringBuilder:

qBuilder01 = new StringBuilder();

Bob
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now