[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1859
  • Last Modified:

trim strings data in dataset

I have a dataset that is selecting data form SQL Server, what i want to do is auto trim by default all fields it returns, where is the best place to do this. I also dont want to add code that may get over written if the data set is regenerated.
0
kplonk
Asked:
kplonk
2 Solutions
 
toddbehnkeCommented:
You can trim it in the select statement.
Select (ltrim(rtrim(fieldname1)), ltrim(rtrim(fieldname2)), from table where .....
0
 
Mihai StancescuSoftware Engineer Commented:
Or you can trim the results in your application after loading them into a datatable, or dataset.



Hope this helps!

Regards,
Mishu
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now