Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Multiline textbox drop the char return when saved to sql

Reply
Thread Tools

Multiline textbox drop the char return when saved to sql

 
 
CalSun
Guest
Posts: n/a
 
      08-24-2005
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


 
Reply With Quote
 
 
 
 
sreejith.ram@gmail.com
Guest
Posts: n/a
 
      08-24-2005
Not sure if u have alreday tried Server.HtmlEncode
http://www.devx.com/vb2themax/Tip/18542
http://msdn.microsoft.com/library/de...46ef320e78.asp

 
Reply With Quote
 
 
 
 
CalSun
Guest
Posts: n/a
 
      08-24-2005
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

<> wrote in message
news: 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
>



 
Reply With Quote
 
Peter Rilling
Guest
Posts: n/a
 
      08-24-2005
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" <> wrote in message
news:%...
> 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
>



 
Reply With Quote
 
CalSun
Guest
Posts: n/a
 
      08-24-2005
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" <> wrote in message
news:%...
> 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" <> wrote in message
> news:%...
>> 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
>>

>
>



 
Reply With Quote
 
CalSun
Guest
Posts: n/a
 
      08-25-2005
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" <> wrote in message
news:%...
> 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
>



 
Reply With Quote
 
=?Utf-8?B?Rm9vbGV5Q29vbGV5MTM=?=
Guest
Posts: n/a
 
      08-27-2005
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" <> wrote in message
> news:%...
> > 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
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(const char *cp) and (char *p) are consistent type, (const char **cpp) and (char **pp) are not consistent lovecreatesbeauty C Programming 1 05-09-2006 08:01 AM
/usr/bin/ld: ../../dist/lib/libjsdombase_s.a(BlockGrouper.o)(.text+0x98): unresolvable relocation against symbol `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostre silverburgh.meryl@gmail.com C++ 3 03-09-2006 12:14 AM
Saved Mail Gone and Sent Mail Not Being Saved Gregg Firefox 6 03-06-2006 02:13 AM
how to define a variable to hold a multiline text input in perl from html multiline textbox dale zhang Perl Misc 8 11-30-2004 06:53 AM
Adding a carriage return to text in a multiline textbox in design view. Simon Middlemiss ASP .Net 2 11-10-2003 09:08 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57