?
Solved

Remove whitespace characters form desplay of text box data in report

Posted on 2008-02-01
3
Medium Priority
?
874 Views
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?
0
Comment
Question by:NettieEckenrode
3 Comments
 
LVL 39

Expert Comment

by:appari
ID: 20798212
try

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

Accepted Solution

by:
arnold earned 200 total points
ID: 20798688
Code snippet available at for Vb as well as c#.:
http://technet.microsoft.com/en-us/library/844skk0h(VS.80).aspx

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:
http://weblogs.sqlteam.com/jeffs/archive/2007/04/27/SQL-2005-Regular-Expression-Replace.aspx
 UPDATE MessyTable
SET MessyColumn = dbo.RegExReplace(MessyColumn, ... , ....)
WHERE ...

Open in new window

0
 

Author Closing Comment

by:NettieEckenrode
ID: 31427185
Perfect...thanks for your help
0

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