data modification on multiuser environment

  • Thread starter Thread starter philip
  • Start date Start date
P

philip

hello i am new to asp.net and sql server 2005 programming. i am
wondering how to code asp.net to prevent multiuser from modifying a
share data (on sql server) at the same time. should i do some special
coding on asp.net or sql server, or both? thanks for your help.
 
when you adding the DataSource (using the wizard) click Advance (when it
askes what fields from witch table you want) and check the 3rd option...

when saving, the DataSource will compare the old values to the database and
if they are the same, it will update thoose fields, if they are not, it will
give you an error that you can handle or just telling the user to refresh
the view because the values were changed from the database since the last
request.
 
so how can i code in a queue way? my idea is, if User_A is modifying
the shared data, and User_B comes in, then how to design to let User_B
wait until User_A has finished the modification? I don't want to throw
exception anyway.

My situation is, the shared data is a counting number that if a user
performs one task, the field will be incremented.

Thanks for your help.

Bruno Alexandre 寫é“:
 
all you need is to turn the feature on

when performing an update the datasource willl see if the data changed for
the last time that was reading for that page and ask the user to refresh the
page

this is done automatically with nothing to hard-code


if you want to implement your own way, fell free to do so, but this approch
is the best way (read data to gridView 4 example) then when you are updating
you have the oldValues at your disposal

e.OldValues.Item("item").ToString under gridview RowUpdating event

just use thoose values to read the same id from the database, if they are
the same, just procedure to the update itself, if not get the new values
from the database and ask the user what he wants to do... or whatever

:-)

it's your call

--

Bruno Alexandre
"a Portuguese in Københav, Danmark"



"philip" <[email protected]> escreveu na mensagem
so how can i code in a queue way? my idea is, if User_A is modifying
the shared data, and User_B comes in, then how to design to let User_B
wait until User_A has finished the modification? I don't want to throw
exception anyway.

My situation is, the shared data is a counting number that if a user
performs one task, the field will be incremented.

Thanks for your help.

Bruno Alexandre ??:
 
Back
Top