|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
concurrency in ado.netHi all,
I want to handle concurrency issue when 2 user try to update same record. What i want is if user1 and user2 are accessing same record and user2 has updated same record then when user1 tries to update that record he should able to update it. Which is not happening currently. Can anyone tell me what should i do? thanks in advance. I won't question whether what you are doing is good or bad.
But if you want to overwrite data you might remove WHERE part of UPDATE/DELETE adapter's commands. -- Show quoteHide quoteMiha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "Archana" <trialproduct2***@yahoo.com> wrote in message news:1176275395.219433.8910@d57g2000hsg.googlegroups.com... > Hi all, > > I want to handle concurrency issue when 2 user try to update same > record. > > What i want is if user1 and user2 are accessing same record and user2 > has updated same record then when user1 tries to update that record he > should able to update it. Which is not happening currently. > > Can anyone tell me what should i do? > > thanks in advance. > Ah, no. You can't remove the WHERE clause as this uniquely identifies the
row to update. If you do remove the WHERE clause, all rows in the table will be updated. You can remove the portion of the WHERE clause that checks for changes by other users. -- Show quoteHide quote____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP INETA Speaker www.betav.com/blog/billva www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ Visit www.hitchhikerguides.net to get more information on my latest book: Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ----------------------------------------------------------------------------------------------------------------------- "Miha Markic" <miha at rthand com> wrote in message news:32107D08-483A-462F-8C10-94AC59D6951F@microsoft.com... >I won't question whether what you are doing is good or bad. > But if you want to overwrite data you might remove WHERE part of > UPDATE/DELETE adapter's commands. > > -- > Miha Markic [MVP C#, INETA Country Leader for Slovenia] > RightHand .NET consulting & development www.rthand.com > Blog: http://cs.rthand.com/blogs/blog_with_righthand/ > > "Archana" <trialproduct2***@yahoo.com> wrote in message > news:1176275395.219433.8910@d57g2000hsg.googlegroups.com... >> Hi all, >> >> I want to handle concurrency issue when 2 user try to update same >> record. >> >> What i want is if user1 and user2 are accessing same record and user2 >> has updated same record then when user1 tries to update that record he >> should able to update it. Which is not happening currently. >> >> Can anyone tell me what should i do? >> >> thanks in advance. >> > "William (Bill) Vaughn" <billvaRemoveT***@betav.com> wrote in message Of course. At least unique identifier has to be present. My bad.news:eQatpGFfHHA.3508@TK2MSFTNGP02.phx.gbl... > Ah, no. You can't remove the WHERE clause as this uniquely identifies the > row to update. If you do remove the WHERE clause, all rows in the table > will be updated. You can remove the portion of the WHERE clause that > checks for changes by other users. :-) -- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ Archana,
That depends if it is something as this Name = Cor Name = Miha Than it is not so important, the name is just set and which one was first is just a matter of seconds who came first. However if if is the result of this. Bankaccount = 100000 (where 100000 is the result of 1000 + 99000) Bankaccount = 1000 (where 100 is the result of 100000 - 99000) Than I shall *not* use the method Miha shows. (As he told in a way in his message he don't want to discuss, but he will find it of course as well bad). Cor Archana" <trialproduct2***@yahoo.com> schreef in bericht Show quoteHide quote news:1176275395.219433.8910@d57g2000hsg.googlegroups.com... > Hi all, > > I want to handle concurrency issue when 2 user try to update same > record. > > What i want is if user1 and user2 are accessing same record and user2 > has updated same record then when user1 tries to update that record he > should able to update it. Which is not happening currently. > > Can anyone tell me what should i do? > > thanks in advance. > Hi, Archana
User 1 needs to send an instant message to user 2. Here is the solution at the article http://www.udaparts.com/document/articles/chatservice.htm. Regards, Show quoteHide quote "Archana" <trialproduct2***@yahoo.com> wrote in message news:1176275395.219433.8910@d57g2000hsg.googlegroups.com... > Hi all, > > I want to handle concurrency issue when 2 user try to update same > record. > > What i want is if user1 and user2 are accessing same record and user2 > has updated same record then when user1 tries to update that record he > should able to update it. Which is not happening currently. > > Can anyone tell me what should i do? > > thanks in advance. >
Other interesting topics
OrderID or DataTable
Currency Manager copying an object by value Getchanges problem on expression column Typed DataSet from existing DataSet using an xml file to store a pre-connection value--- client-server app where data is disconnected, but stays fresh Concurrency Problem: Two separate dynamic SQL queries. SqlCommandBuilder.DeriveParameters not working for CLR Stored Procedure. ADO.NET Abstraction Layer: Basic SQL building blocks? |
|||||||||||||||||||||||