3

I use System.Environment.NewLine to add a line feed between lines. This is in a C# dll. This dll uses IBM RATIONAL CLEARQUEST API's to insert into Oracle database these values. CLEARQUEST is setup in a Linux box and I am not sure under which OS the Oracle is setup.

Point is the System.Environment.NewLine i use in concatination (with + operator on string) does not work. The text comes as continuous string.

How can i realize the line breaks in C#. I tried with \r\n but same result.

has any one faced this problem? I am not sure if the platform could be a factor here

KK99
  • 1,971
  • 7
  • 31
  • 64
  • 1
    the linebreak disappears after you read data from the database, or is it absent before data is sent to the db? – Eugenio De Hoyos Mar 17 '11 at 04:23
  • it is present when its sent to DB i can see that when i put a Breakpoint. not sure what is happening. Another point is the data sent to DB is via the IBM CQ API's – KK99 Mar 17 '11 at 04:57
  • I see you mentioned it's present when sent to the DB as observed through a breakpoint - if you're still in C# (especially in your code), that makes sense. Can you see the actual insert query being performed by CQ via a DB profiler? It may very well be that it's not escaping characters as expected... – J Trana Mar 17 '11 at 06:42
  • I will see if that could be possible – KK99 Mar 17 '11 at 08:50

1 Answers1

3

Try

string CRLF = "\x0d\x0a";

And use that instead of Environment.Newline.

source http://www-01.ibm.com/support/docview.wss?uid=swg21120820

Bala R
  • 107,317
  • 23
  • 199
  • 210