Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ASP, Textfields and Spaces

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-06-04 : 07:33:15
Dawson865 writes "Hi,

I had a look around, but am not quite sure which is the best way of handling the problem of spaces in textfileds.

When passing info to SQL via a text field (to be displayed with HTML later) what is the best way of maintaining the orignal formatting (spaces)?

Do you guys use a script?

Thanks."

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-06-04 : 09:17:23
Spaces or linefeeds ?

If you need to keep linefeeds you can do :

Response.Write Replace(rs("MyTextField"), vbCrlf, "<br>")



Damian
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-06-04 : 09:21:34
The problem has less to do with storing in SQL Server, and more to do with displaying it in HTML. Just wrap such text in <pre></pre> tags to maintain orginial formatting, while displaying it.

Owais

Go to Top of Page
   

- Advertisement -