problems with updating Database

J

Jarod_24

I have tried with the following statements to update a database-table from a
asp page

....
myrow("Telephone") = txtTel.Text
....

But the info dosen't get updated.
Everything else works. I know that since i tried a adding a string to one of
the fields.

myrow("Telephone") = txtTel.Text & "-updated-"

And the "-updated-" showed up in the table.

I realize that someting about the textboxes are wrong.
EnableViewState is set to 'True' for all the textboxes i use.
 
N

Natty Gur

Hi,

EnableViewState is useless for TextBoxes since their value transfer
anyway via page Form. Did you check (with trace) what is the value that
your txtTel send from the client?


Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
J

Jarod_24

I found out what was the problem.... *embarrased*

In Page_Load i read in from the Database Table and gave the TextBoxes their
values, but without checking if the textboxes had anything in them from
before,
so whatever the user had typed in the textboxes would be overwritten with
the values from the database. *grin*

Now that i know this; is there any way to check that the page has been
"reloaded".
Right now i chech If txtTelephone.Text.Trim.Lenght > 0, but sometimes the
Textbox will be empty and the page is still beign reloaded.

Does there exist any sort of "Page.hasbeenReloaded" function or something
that will be more appropriate to use?
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top