0

I have a StoredProcedure that returns a string. In the string I put CHAR(13) and CHAR(10) to have carriage return and line feed. I read the string from a winform in VB.NET and the string correctly has a "VBCrLf" in it. When I look at the string during debug (you know, using the little magnifing glass) the lines are correctly there.

THEN: I put the string in the text of a Multiline Textbox and the lines disappear, everything is on a single line.

If I then apply:

myString.Replace(vbCrLf, vbNewLine)

and put it back in the same textBox, everything works fine again.

How can avoid the replace? Thankx

Johannes Wentu
  • 931
  • 1
  • 14
  • 28
  • I've tried your scenario and the problem did not appear using SELECT 'aaa'+CHAR(13)+CHAR(10)+'bbb'. vbCrLf has the same bytes as vbNewLine, so the problem must be hidden somewhere else - wrong UTF8 character around you newline that gets fixed by the replace call. Try replace "a" for "a" to see if it fixes the issue – PavlinII Apr 12 '18 at 09:53
  • thank you for your answer. here what happened later: I came back to the same line, remove my "replace" in order to reproduce the error and then try your solution but... the error wasn't there anymore. I don't think I changed anything meaningful but now it's working perfectly, dunno why. – Johannes Wentu Apr 13 '18 at 06:15

0 Answers0