When I databind a value/text combination from an
sqldatareader to a dropdownlist, the trailing spaces are
getting included in the dropdownlist. I can RTRIM from
within the SQL to fix this problem, but I am wondering if
there is a more elegant solution to trim all the
text/value combinations in a dropdownlist.Hi William
To my knowledge, there is not an elegant way from dropdownlist side. One
clumsy way I can think of is to populate a new collection or arraylist that
contains the data fields to be bound to the dropwodnlist. While populating
this new collection or arraylist we can trim the data accordingly.
Please let me know if it makes sense.
Best regards,
Jacob Yang
Microsoft Online Partner Support
Get Secure! C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Yes, that makes sense. Thank you.
>--Original Message--
>Hi William
>To my knowledge, there is not an elegant way from
dropdownlist side. One
>clumsy way I can think of is to populate a new
collection or arraylist that
>contains the data fields to be bound to the
dropwodnlist. While populating
>this new collection or arraylist we can trim the data
accordingly.
>Please let me know if it makes sense.
>Best regards,
>Jacob Yang
>Microsoft Online Partner Support
>Get Secure! C www.microsoft.com/security
>This posting is provided "as is" with no warranties and
confers no rights.
>.
Saturday, March 31, 2012
Trimming data in dropdownlist from sqldatareader
Labels:
ansqldatareader,
aregetting,
asp,
combination,
databind,
dropdownlist,
included,
net,
spaces,
sqldatareader,
text,
trailing,
trimming,
value
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment