Dateset question

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

I am doubtful about some point or confuse on design program.
User A run Invoice form, Load the current month data into the dataset.
ADMIN want to lock some invoices , so ADMIN just update the dataset in his
"admin form"
Now, if USER A never exit the form, He can amend the record everytimes.
Does anyfunction set auto refresh in USER A 's invoice form ??
or I should change some design, for example, extra security tables, If USER
A amend the record, a extra function to check the status out side from the
dataset , so It must be up-to-date.

Please give some advice.
Thanks a lot
 
Hi,

The easiest way is to have a date/time stamp field in the table. Whenever
an update occurs, update this field. Whenever you do an update check this
field in your dataset against the current field in the table. If it doesn't
match anymore then you know someone else updated the record since you first
retrieved it. Relay this news to the user along with the new data and then
ask them to re-do the update. That should get you started. You can do more
complicated things like saving what the user entered so they don't have to
re-key it in when there is a concurrency issue and etc. Good luck! Ken.
 
thanks Ken, But I don't understand for some points.
How can I [ do an update check this field in your dataset against the
current field in the table ]??
Where should I [do an update ]? Invoice Form ?
 
Hi,

I think I read your original post wrong. You wanted to be able to actually
lock the invoices for a while, not check for concurrency. To do that you
could put a field in the invoice table (i.e. Locked). If it is 0 then the
invoice is unlocked, if it is 1 then the invoice is locked. Then if you
query this field before you do an update you'll know if the user can do the
update or not. For example:

User loads invoice and starts editting it.
Admin locks invoice.
User finishes editting and tries to update.
Your code would first look at the invoice number the user is trying to
update. Then it would go to the database and check the Locked field on that
record. If it is unlocked then you would do the update. If it is locked
then you could send a message back to the user telling them that the invoice
has been locked.

Good luck! Ken.

Agnes said:
thanks Ken, But I don't understand for some points.
How can I [ do an update check this field in your dataset against the
current field in the table ]??
Where should I [do an update ]? Invoice Form ?

Ken Dopierala Jr. said:
Hi,

The easiest way is to have a date/time stamp field in the table. Whenever
an update occurs, update this field. Whenever you do an update check this
field in your dataset against the current field in the table. If it doesn't
match anymore then you know someone else updated the record since you first
retrieved it. Relay this news to the user along with the new data and then
ask them to re-do the update. That should get you started. You can do more
complicated things like saving what the user entered so they don't have to
re-key it in when there is a concurrency issue and etc. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight

If
USER
 

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

Back
Top