Connecting Tech Pros Worldwide Help | Site Map

problems with updating Database

Jarod_24
Guest
 
Posts: n/a
#1: Nov 18 '05
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.


Natty Gur
Guest
 
Posts: n/a
#2: Nov 18 '05

re: problems with updating Database


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


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jarod_24
Guest
 
Posts: n/a
#3: Nov 18 '05

re: problems with updating Database


"Natty Gur" <natty@dao2com.com> wrote in message
news:uNP%230FABEHA.1452@TK2MSFTNGP09.phx.gbl...[color=blue]
> 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?[/color]


trace?


[color=blue]
>
> Natty Gur[MVP]
>
> blog : http://weblogs.asp.net/ngur
> Mobile: +972-(0)58-888377
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]


Jarod_24
Guest
 
Posts: n/a
#4: Nov 18 '05

re: problems with updating Database


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?



"Jarod_24" <jarod_24@hotmail.com> wrote in message
news:f046d3cb350506607623aaff28e5cf63@news.teranew s.com...[color=blue]
> I have tried with the following statements to update a database-table from[/color]
a[color=blue]
> 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[/color]
of[color=blue]
> 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.
>
>[/color]


Natty Gur
Guest
 
Posts: n/a
#5: Nov 18 '05

re: problems with updating Database


Hi again

1) Page.Trace or System.Diagnostics.Debug.Write.
2) IsPostBack should give you indication if the page "hasbeenReloaded".

Natty Gur[MVP]

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


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