Re: How to get rid of those spaces efficiently?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Arsalan (arsalan_aslam_at_hotmail.com)
Date: 02/22/05


Date: Wed, 23 Feb 2005 02:23:41 +0500

Trim in the SQL statement for e.g
select TRIM(last_name) as TRIMMED_LASTNAME from employees

[I guess that will do in SQL server or MS Access, the trim function may
differ from database to database for e.g in Oracle you've two argument for
TRIM, so be sure to check it out]

"Andrew" <Andrew@discussions.microsoft.com> wrote in message
news:6178BACE-0D3C-40BE-A9D7-DBACF8D8B66B@microsoft.com...
> In the returned records in a DataSet, all the VARCHAR() field values are
> appended many spaces. When displaying each value, we have to use
> .ToString().Trim(). This is really annoying. Do we have a way to do this
> more
> efficiently, say, only trimmed VARCHAR() field values are returned?
>
> Thanks in advance.



Relevant Pages

  • Re: Problem using LEN function in WHERE clause on OLEDB Jet 4.0 driver
    ... Actually using Trim VBA function in a SQL statement will not work in all ... NULL rather than trim it. ... > The concatenation of and an empty string will transform any ...
    (microsoft.public.data.ado)
  • Re: Textbox Web Control
    ... Karen, you can trim it as you retrieve data, that is taking this to your ... datalayer in your sql statement, use the trim function in sql like: ... Or after having bound your textbox that is after it is filled with data use ... the trim function of you textbox like i showed you in my previous post. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)