1
Reply

how to break line in data while inserting to a table

Nepethya Rana

Nepethya Rana

Aug 30 2017 12:15 PM
184
we have data in one of a table which has
tag to break line while rendering the data in web.
for example:
Day | ToDoList
------------ ----------------------------------
Sunday | Wake up at 8am
Visit Parents
------------ ----------------------------------
Monday | Wake up at 7am
Go to Work
------------ ----------------------------------
I need to get the data from that table and need to load in another table for another application, which also render
the data in browser. But this application export this data in excel file as well.
I do not want
tag between data in my new table and excel file but i do want line break.
Day | ToDoList
------------ ----------------------------------
Sunday | Wake up at 8am
| Visit Parents
------------ ----------------------------------
Monday | Wake up at 7am
| Go to Work
------------ ----------------------------------

How do i achieve this.
This is what i have tried but it did not work.
#1
If Not String.IsNullOrWhiteSpace(row("ToDoList").ToString) Then
cmd.Parameters.AddWithValue("@pToDoList", (row("ToDoList").ToString).Replace("
", vbCrLf))
Else
#2
If Not String.IsNullOrWhiteSpace(row("ToDoList").ToString) Then
cmd.Parameters.AddWithValue("@pToDoList", (row("ToDoList").ToString).Replace("
", Environment.NewLine))
Else
#3
If Not String.IsNullOrWhiteSpace(row("ToDoList").ToString) Then
cmd.Parameters.AddWithValue("@pToDoList", (row("ToDoList").ToString).Replace("
", "+Char(13)+char(10)"))
Else

Answers (1)