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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top