Save the value from Multiline Textbox into SQL Server with line brea

后端 未结 2 502
遥遥无期
遥遥无期 2021-01-23 20:55

I got one multiline textbox call txtDesc. The user can key in multiline value such as :

Hai.
I\'m robot.
Please feed me.

I want to save into da

2条回答
  •  离开以前
    2021-01-23 21:27

    Love the sample text :)

    How are you saving and loading this to/from SQL ? If I have a multiline textbox, the .Text property includes the line break character -

    "Hai.\n\I'm robot.\n\Please feed me."
    

    I save this into an NVARCHAR(MAX) field in a table in SQL, and when I load it back into the textbox, I get the line breaks exactly as it was typed in.

    Can you post your your load/save code ?

提交回复
热议问题