views:

153

answers:

1

I have several multi-line text fields in an entity in CRM 4. When I load the value from one into a multi-line Windows.Forms.Textbox in C# through the SDK using something like

this.textBox.Text = myOpportunity.new_detail.ToString();

the newline characters aren't transferred properly. They show up as small squares in my C# form field.

How can I convert these properly in both directions (Fetch and Update)?

+1  A: 

I suspect they're coming through as just line feed (\n) instead of carriage return line feed (\r\n).

You can probably just do a simple replace:

this.textBox.Text = myOpportunity.new_detail.ToString().Replace("\n", "\r\n");

and then the reverse in the opposite direction.

Jon Skeet
That did it. Thanks!
Eric Sukalac