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

后端 未结 2 501
遥遥无期
遥遥无期 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

    i got the answer :

    To save from multiline textbox to database :

      Dim strDesc As String
      strDesc = ReplaceNewLines(txtDesc.Text, True)
    

    To show back from database to multiline textbox :

    strDesc = productDetails.ProductDesc.Replace("
    ", vbCrLf) txtDesc.Text = strDesc

提交回复
热议问题