How to make sure that data displayed on a form is the newest data?

  • Thread starter Thread starter Dino Buljubasic
  • Start date Start date
D

Dino Buljubasic

Hi,

I am using VS2005 (C#) and SQL Server 2000.

How can I make sure that:

1. Client A queries info from database and displays it in a list view
or other controls on a form. If Client B changes some of this info
that is displayed by client A, clint A gets its info updated

2. If clint B tries to delete data currently displayed by client A,
the attempt should fail.

How can I make sure that database data displayed on the client's forms
is always newest data?

Any help will be appreciated.

_dino_
 
Dino,

You will have to create some sort of update mechanism which will notify
other consumers of the same data if something has changed.

Also, it's not really realistic to hold onto records in the way that you
want to do. Rather, what you should do is have a timestamp of some sort on
the record. Then, when you want to change the record, check to see if the
timestamp is the same as the one you have. If it is, then perform your
change, otherwise, you have to fail the operation, since the record was
changed already.

Hope this helps.
 
Back
Top