473,325 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Multiline textbox drop the char return when saved to sql

Hi all,
I try to save a multiline textbox into an sql field (nvarchar(1024)). As I
read it out and display, the text drops all the linefeed char.
Is there a way to cure this? Thank you all for help.

--Calsun
Nov 19 '05 #1
6 2531
Thanks for the tips.
I tried it and it didn't work. I decoded before saving and encoded back, but
the linefeed char still missing.

Your help please. Thanks
--CS

<sr**********@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Not sure if u have alreday tried Server.HtmlEncode
http://www.devx.com/vb2themax/Tip/18542
http://msdn.microsoft.com/library/de...46ef320e78.asp

Nov 19 '05 #3
When you render the content, it renders it as HTML text. The problem is
that the browser ignores whitespace. Before rendering it, you will need to
change all linefeeds to <br>.

"CalSun" <ca****@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi all,
I try to save a multiline textbox into an sql field (nvarchar(1024)). As I
read it out and display, the text drops all the linefeed char.
Is there a way to cure this? Thank you all for help.

--Calsun

Nov 19 '05 #4
Thanks Peter,
I'll try that.
By the way, what is the value of the linefeed char inside a multiline
textbox?
thanks
--CS
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
When you render the content, it renders it as HTML text. The problem is
that the browser ignores whitespace. Before rendering it, you will need
to change all linefeeds to <br>.

"CalSun" <ca****@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi all,
I try to save a multiline textbox into an sql field (nvarchar(1024)). As
I read it out and display, the text drops all the linefeed char.
Is there a way to cure this? Thank you all for help.

--Calsun


Nov 19 '05 #5
Thank you all for helping.
I just converted ctrlf into <br> before saving. That works fine. However, it
won't look good if I query and display the text in a non-html environment.
--CS

"CalSun" <ca****@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi all,
I try to save a multiline textbox into an sql field (nvarchar(1024)). As I
read it out and display, the text drops all the linefeed char.
Is there a way to cure this? Thank you all for help.

--Calsun

Nov 19 '05 #6
When rendering in non-html just use the following concept to deal with the BR
tags:

// C# Code
string x = "some text<br>some more text<br>blah blah blah";
x = x.Replace("<br>", "\r\n");

' VB Code
Dim x as string = "some text<br>some more text<br>blah blah blah"
x = x.Replace("<br>", vbCrLf)

"CalSun" wrote:
Thank you all for helping.
I just converted ctrlf into <br> before saving. That works fine. However, it
won't look good if I query and display the text in a non-html environment.
--CS

"CalSun" <ca****@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi all,
I try to save a multiline textbox into an sql field (nvarchar(1024)). As I
read it out and display, the text drops all the linefeed char.
Is there a way to cure this? Thank you all for help.

--Calsun


Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael C | last post by:
Hi all, I'm trying to add lines to a multiline textbox. Here's what I'd like to end up with in the textbox (as an example): Line1 Line2 Line3 I've tried a couple of methods but nothing...
7
by: Joel Finkel | last post by:
Folks, I have a form that has several TextBoxes, some of which have the TextMode set to MultiLine. Each is pre-loaded with data from a database. The user is allowed to modify each entry. The...
4
by: hardcoded | last post by:
I have a textbox with TextMode set to MultiLine. I also have the MaxLength set to 255. This maxlength value seems to get ignored as the user can enter unlimited characters. Does the multiline...
2
by: Enzo Marinelli | last post by:
Hello everyone I have a MultiLine TextBox, as follows <asp:TextBo Id="StreetAddress Rows="4 Runat="Server TextMode="MultiLine Width="100%"/
4
by: ian | last post by:
Hi, I am currently using a Javascript function to dissallow the enter key on my ASP.NET (2.0) web page, as follows: function fnTrapKP(){ if (document.all) { if (event.keyCode == 13) {
7
by: Milsnips | last post by:
Hi there, Can anyone help me out on this one? i want to read each line entered in a multiline textbox and store it into an array. I cant find any properties for this in the control, the only...
7
by: Anil Gupte | last post by:
I have read a lot about getting lines from a multiline textbox in VB.Net. However, I cannot for the life of me figure out how to write to a multiline textbox. Basically, I have created an array of...
4
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In multiLine textBox, enter moves to the next line, how can i overwrite it, so enter will move to the next control and ctrl + enter will move to the next line? Thanks, Gidi.
10
by: JohannKotzeVet | last post by:
Good day! I have a form in Access that has a multiple line textbox (I called it cAbnormalities). This text box is populated by the user ONLY through selection of options from combo boxes. I want...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.