problems with updating Database

  • Thread starter Thread starter Jarod_24
  • Start date Start date
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.
 
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
 
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?
 
Back
Top