[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Karen A Hodge

2/13/2004 6:50:00 AM

Hello,
I have a SQL Server table which has several columns that are of type
varchar.
I have bound textboxes for this table on a Web form. The form is used for
data entry.

Question: How do I get rid of the trailing blanks on the control?

The blanks are annoying because you can't insert characters because the
maxlength has been reached. Right now I have to delete the trailing blanks
before I can successfully edit the field.

This seems like a trivial thing to me, but I can't figure out how to do it.

Thanks


7 Answers

Alessandro Zifiglio

2/13/2004 7:16:00 AM

0

Textbox1.Text.Trim
This should trim trailing spaces towards the left and right of your text
thats within your textbox control.

"Karen A Hodge" <mshodge@pacbell.net> wrote in message
news:Oc5sw3f8DHA.1592@TK2MSFTNGP10.phx.gbl...
> Hello,
> I have a SQL Server table which has several columns that are of type
> varchar.
> I have bound textboxes for this table on a Web form. The form is used for
> data entry.
>
> Question: How do I get rid of the trailing blanks on the control?
>
> The blanks are annoying because you can't insert characters because the
> maxlength has been reached. Right now I have to delete the trailing blanks
> before I can successfully edit the field.
>
> This seems like a trivial thing to me, but I can't figure out how to do
it.
>
> Thanks
>
>


Nikerz Inc

2/13/2004 11:27:00 AM

0

Hi Karen,

Would you be able to share your binding code, I'm having a hard time finding
information to bind textboxes to datasets and update them back to a
database!

Thx!

"Karen A Hodge" <mshodge@pacbell.net> wrote in message
news:Oc5sw3f8DHA.1592@TK2MSFTNGP10.phx.gbl...
> Hello,
> I have a SQL Server table which has several columns that are of type
> varchar.
> I have bound textboxes for this table on a Web form. The form is used for
> data entry.
>
> Question: How do I get rid of the trailing blanks on the control?
>
> The blanks are annoying because you can't insert characters because the
> maxlength has been reached. Right now I have to delete the trailing blanks
> before I can successfully edit the field.
>
> This seems like a trivial thing to me, but I can't figure out how to do
it.
>
> Thanks
>
>


Karen A Hodge

2/13/2004 4:40:00 PM

0

Thank you for your reply.

I bind my textboxes at design time.
This is my custom databinding expression:
DataBinder.Eval(MembersDS,
"Tables[spSelectMember].DefaultView.[0].Title")

At what point do you suggest that I trim the data?





*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!

Alessandro Zifiglio

2/13/2004 5:18:00 PM

0

Karen, you can trim it as you retrieve data, that is taking this to your
datalayer in your sql statement, use the trim function in sql like :
select trim(title) from bla
and then bind to your textbox.

Or after having bound your textbox that is after it is filled with data use
the trim function of you textbox like i showed you in my previous post.

On a side node, to avoid such situation you should always trim the data
before storing it into your database.


"Karen Hodge" <mshodge@pacbell.net> wrote in message
news:eMqfMAl8DHA.2832@tk2msftngp13.phx.gbl...
> Thank you for your reply.
>
> I bind my textboxes at design time.
> This is my custom databinding expression:
> DataBinder.Eval(MembersDS,
> "Tables[spSelectMember].DefaultView.[0].Title")
>
> At what point do you suggest that I trim the data?
>
>
>
>
>
> *** Sent via Developersdex http://www.develop... ***
> Don't just participate in USENET...get rewarded for it!


Nikerz Inc

2/13/2004 9:56:00 PM

0

Hi there,

I'd suggest to trim the data while you load it from your SQL string
something like select ltrim(memeber) from employee That should work, would
you be able to share more code, I'm trying to bind a from that I enter
customer information into to my database, I'm having a problem actually
binding the textboxes to my dataset.

Thanks!

"Karen Hodge" <mshodge@pacbell.net> wrote in message
news:eMqfMAl8DHA.2832@tk2msftngp13.phx.gbl...
> Thank you for your reply.
>
> I bind my textboxes at design time.
> This is my custom databinding expression:
> DataBinder.Eval(MembersDS,
> "Tables[spSelectMember].DefaultView.[0].Title")
>
> At what point do you suggest that I trim the data?
>
>
>
>
>
> *** Sent via Developersdex http://www.develop... ***
> Don't just participate in USENET...get rewarded for it!


Karen A Hodge

2/13/2004 10:59:00 PM

0

Alessandro,
Thanks, I figured that out as a result to your first posting. I have not
had that problem before. The data in this table was imported from a
Foxpro table, which explains why the data was not trimmed in the first
place.



*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!

baldeagle

12/29/2008 1:27:00 AM

0

On Dec 28, 3:33 am, Wang Youwang <kink...@yahoo.com> wrote:

>
> Before TAIWAN reaches any more "agreements" with....,
> to had best talk to the Hong Kong folks.
>

You are stupid...to think that Taiwanese are not
aware of conditions in Hong Kong and Tibet.
Taiwanese are everywhere in China..every corner..
they know what they are doing and why they are
doing it.

It is precisely, they have seen and talk to folks
everywhere in China, they are signing agreements
with China..for mutual benefits.

The economic conditions for Taiwanese has
improved, business has improved..since Ma
booted out Chen. The improvements are due
to better relationship Ma has achieved so
far with China.