Insert line breaks in return records of a stored procedure

Posted on 2011-10-10
Medium Priority
Last Modified: 2012-05-12
I ahve a stored procedure with many fields returned. One of the fields combines the values of 3 separate fields into one. I would like to inert line breaks in the field so that each of the three fields are displayed on their own line. The final display is on a web page. Is there a way to do this?
Question by:dodgerfan
  • 2
LVL 11

Accepted Solution

techhealth earned 2000 total points
ID: 36943590
You can insert CHAR(13) + CHAR(10) in your result to add the CRLF.  However depending on how the webpage uses the data, it may or may not give you the correct new line layout.  You might want to make the webpage code detect the inserted CRLF, then replace it with something proper, such as <br>.

Author Comment

ID: 36943814
thanks, I have the stored procedure updated, but like you mentioned the webpage is not showing it right. How do you replace the CRLF in the code? I'm using C# and asp.net. Right now the field is pulled using <%# Eval("Title") %>. Is there an example somewhere?

Author Closing Comment

ID: 36943898
Got it working right in the dispplay page as well. Thanks for the help.

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question