Updating datasets Question

G

Guest

I use a stored procedure to return a dataset.
A datatable in that dataset is used as the datasource
for a datagrid.
I add/delete/modify data via the datatable and now
I want to update the SQL server.
How can I tell if someone else modified the same
record between when I retreived it and when I want to
update it?
 
B

Bob Dufour

Use a timestamp field in each record. It gets changed by sql server every
time the record is modified. Compare the time stamp of the record you got
with the record that is currently in the database before you finalize the
update. If the time stamp has chenged, someone else has made a change to the
record between the time you selected it and now when you want to update it.
Hope this helps,

Bob
 

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