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

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

Nicholas Paldino [.NET/C# MVP]

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.
 

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