Member of the LearnItFirst.com Video Training Network | LearnSqlServer.com | SQL SSIS Training | SQL Programming Tutorials |
LearnSqlServer.com Forums LearnSqlServer.com
Welcome Guest Search | New Posts | Members | Log In | Register

no new rows in inserted text Options
Medes
Posted: Saturday, July 26, 2008 4:59:55 PM
Rank: Newbie

Joined: 7/26/2008
Posts: 2
Points: 6
Location: sweden
Hi everybody,

I am using sql server 2005 express and windows server 2003.

I am using usual insert command to insert a text into a table with a column which is ntext. I have used enter key to make new lines in my text when i inserted it to the table but when i browse to another page to show the text (on my web site) the text is only one single line.
i am using following code to show the text.

<p>
<asp:Label Text='<%# Eval("Body"Wink %>' runat="server" ID="descriptionLabel" />
</p>

thanks for your help
Scott Whigham
Posted: Monday, July 28, 2008 10:14:34 AM


Rank: Super Mod

Joined: 3/20/2006
Posts: 345
Points: 748
Location: Dallas, TX
Well, if you want the text from the database to have line breaks in it, you must store the HTML (or have a method that converts line breaks to HTML).
Code:
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <br /><br />Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
Will display like this:
Quote:

arkred">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
In other words, use <br /><br /> in your data since that is HTML for break!
Medes
Posted: Monday, July 28, 2008 11:15:47 AM
Rank: Newbie

Joined: 7/26/2008
Posts: 2
Points: 6
Location: sweden
Thank you
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
     
Don't Forget!
LearnItFirst.com
Don't Forget!
LearnExchange.com
 
Home | About Us | Support | Contact Us | Privacy | Site Map | Blogs Blogs Refer a Friend and Get a Free Subscription!
© Copyright 2004-2007 LearnItFirst.com LLC. All rights reserved. All trademarks remain the property of their respective owners.
This site is not affiliated in any way with the Microsoft Corporation.