You could always:
return new SqlString(text.Value.Replace("\\r\\n", "\r\n"));
Aaron
2010-01-29 13:37:23
You could always:
return new SqlString(text.Value.Replace("\\r\\n", "\r\n"));
In T-SQL you don't write a line break as \r\n
. Instead you just use a line break:
'this
is a
string
in SQL
with
line breaks'
If you pass a string with \r\n
to the C# code, nothing magical happens, it doesn't automatically get converted. The backslash character is just a character like any other. It's when you use the backslash in a literal string in the code that the compiler uses it as an escape code, and puts the control characters in the actual string.