Updates not made in database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form which loads some database fields on the form that are bounded
to some textboxes. The dataadapter allows for select, update etc. But when I
change the information in the textboxes on the form, it is not updated to the
database. I use the function calls.

sqldataAdapter1.Update(dataset1)

I even tried calling dataset1.AcceptChanges() before and then after the
Update() call, without success.
 
L.A. Jones,

You can't call AcceptChange before the call to Update, as it will accept
the changes, and the adapter won't see any changes to update.

You might want to check the binding context, and finish the edit on the
current row (the currency manager that you get from the binding context will
allow you to do this). Then, the change should be noted in the dataset, and
the update should work,

Hope this helps.
 
Ta-naa, it worked, thank you.
--
L. A. Jones


Nicholas Paldino said:
L.A. Jones,

You can't call AcceptChange before the call to Update, as it will accept
the changes, and the adapter won't see any changes to update.

You might want to check the binding context, and finish the edit on the
current row (the currency manager that you get from the binding context will
allow you to do this). Then, the change should be noted in the dataset, and
the update should work,

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dave said:
I have a form which loads some database fields on the form that are bounded
to some textboxes. The dataadapter allows for select, update etc. But when
I
change the information in the textboxes on the form, it is not updated to
the
database. I use the function calls.

sqldataAdapter1.Update(dataset1)

I even tried calling dataset1.AcceptChanges() before and then after the
Update() call, without success.
 
Back
Top