Remove whitespace characters form desplay of text box data in report

Posted on 2008-02-01
Medium Priority
Last Modified: 2013-11-26
I have a text box on my report that dispays data from a ntext field in SQL 2005.  I need to remove the tab and returns from the display.  trim does not seem to work.  is there a function within Visual studio 2005 that I can use to strip these out?
Question by:NettieEckenrode
LVL 39

Expert Comment

ID: 20798212

yourvariableName = yourvariableName.replcae(vbtab,"").replace(vbcrlf,"")
LVL 81

Accepted Solution

arnold earned 200 total points
ID: 20798688
Code snippet available at for Vb as well as c#.:

It might be better to run an update query directly on the SQL server to strip the unwanted characters from the field.
\r, \n,  \t are the regex.

Do not have a working example at hand, but the following link has the enclosed example:
 UPDATE MessyTable
SET MessyColumn = dbo.RegExReplace(MessyColumn, ... , ....)

Open in new window


Author Closing Comment

ID: 31427185
Perfect...thanks for your help

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Suggested Courses

601 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