Updates not made in database

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
G

Guest

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.
 

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