1

I want to be able to store strings in the DB but some are long and i want to format them such that when i copy them out of SQL and past them into notepad they have line breaks to break up the otherwise single line that runs on forever and hard to read.

lets say i am storing a string of all the session variables like this, how do i include line breaks in here?

StringBuilder theBody = new StringBuilder();

theBody.Append("Session Values: " + "\n");
foreach (string s in Session.Keys)
theBody.Append(s + ":" + Session[s] + "\n");
1
  • How are you writing strings to SQL now? Commented Feb 10, 2011 at 18:04

1 Answer 1

1

You might want to consider changing those "\n" to System.Enviornment.NewLine instead. And also, you can use AppendLine instead of Append.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.