0

hi.
i use a textbox (i also tried with a textarea) in asp .net2.0 to show some text from a data base. till this point, everything's ok. my problem starts when i try to change the text and update the new value to the data base. the value updated is always the old one...

i use this line to give the textbox the value of the data base

txt1.text = dbdatareader.item(0) (funny part is that if i delete this line it works perfectly, but i new to show the database value)

please help me

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by DeOiD
0

Hello,

It sounds like you are populating the textbox on load but you are not wrapping a check to see if the page has posted back around the databind.

For example...

Textbox1.Text = dbdatareader.item(0)

Becomes...

If Not.PageIsPostback Then
    Textbox1.Text = dbdatareader.item(0)
End If
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.