Editing WebForm Data

J

Joe Delphi

Hi,

I am having trouble editing bound data in a webform. My textbox is
bound to an underlying dataset. The dataset is filled with a single record
during the page load event using the Fill() and DataBind() methods. The
data appears in the text boxes and all is well up to this point.

I then edit the data by changing some of the text in the text box.

I then press a button which fires an event handler which is supposed
to update the underlying record in the database. The problem is that when
I step through this event handler with the debugger and examine the
properties of the textbox, it appears as if no change has taken place.

Me.txtNotes.Text = <same value before editing>

Needless to say, when it gets down to the DataAdapter.Update() call,
it Updates without no error thrown, but the data is the old data and not the
new changes.

Can anyone tell me what I am doing wrong?

Q1: I thought that if the dataset was filled using the Fill()
method that it was then ready to accept changes. Is this true or do I have
to something in addition to this to prepare the dataset for changes.

Q2: Perhaps I have to store the dataset in Session before I
attempt to Update it?


JD
 
G

Guest

More than likely you're accidentally re-binding your textbox on the page load
event all over again. Put a breakpoint there and see.
 

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

Top