|
-
Aug 30th, 2005, 06:13 AM
#1
Thread Starter
Lively Member
[RESOLVED] Trimming bound controls values
i have text- & comboboxes displaying char(255) data from SQL Server database.
if i input value with length 50 chars and press "Save", 205 blanc spaces are added (255 minus trimmed value's length) at the end.
how to enable text- and comboboxes to show trimmed values (w/out editing records)?
-
Aug 30th, 2005, 09:01 AM
#2
Thread Starter
Lively Member
Re: Trimming bound controls values
...maybe datatable control has any property to make char values trimmed?
and is it possible to trim items of bound combobox manually?
-
Aug 30th, 2005, 09:42 AM
#3
Re: Trimming bound controls values
A bound control displays the data it is bound to, plain and simple. Perhaps you could add an extra column to your DataTable to contain the trimmed values which can be bound to the controls, then just transfer the values to the other column as needed.
-
Aug 30th, 2005, 09:51 AM
#4
Thread Starter
Lively Member
Re: Trimming bound controls values
Re.: plain and simple:
yes, it is.
Re.:extra column:
i have already expression columns.
adding a new extra column per each text column would enlarge my project which is more than enough large (pls see my other threads - they are all related on the same project).
maybe i need to change data type of column in dataset or in MS SQL Server table ("string(255)" and "char(255)" now)?
i need 255 to be MAX length of a string, not FIXED one.
pls advise if you can.
 Originally Posted by jmcilhinney
A bound control displays the data it is bound to, plain and simple. Perhaps you could add an extra column to your DataTable to contain the trimmed values which can be bound to the controls, then just transfer the values to the other column as needed.
-
Aug 30th, 2005, 01:11 PM
#5
Thread Starter
Lively Member
Re: Trimming bound controls values
is there any data type with limited but without fixed length?
-
Aug 30th, 2005, 01:27 PM
#6
Re: Trimming bound controls values
-
Aug 30th, 2005, 01:34 PM
#7
Thread Starter
Lively Member
Re: Trimming bound controls values
Many thanks techgnome,
Pls advise if changing data type from char to varchar in MS SQL Server database causes error in my program?
do i need to reconfigure adapters (vs2005 beta2) and/or make any changement in bindingsources?
sorry, i can try but the project is TOO slow in design mode so advise if have time...
 Originally Posted by techgnome
varchar....
-tg
-
Aug 30th, 2005, 01:52 PM
#8
Thread Starter
Lively Member
Re: Trimming bound controls values
thanks again to techgnome.
resolved.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|