I have a Winform application built with C# and .Net 2.0. I have a textbox set with the MultiLine property.
The problem is when someone writes text with multiple lines (press few enters), presses the save button, and then closes and loads the form again, all the new lines disappear (the text is there at least).
For example, if the textbox had this in it:
Line1 Line3
It will look like this after I save and load:
Line1 Line3
Any idea why?
Update
The database is PostGres and when I use PGAdmin I can see all the line AND the ‘enters’. So the persistence seem to have save all the line… the problem seem to be when I put back the string in the Textbox.
If I recall correctly, the textbox is really a string array.
I think you can do this:
Edit again: If you want to keep the blank lines, the change to StringSplitOptions.None