How to get rid of those spaces efficiently?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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]
 
Back
Top