Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Data Binding / October 2005

Tip: Looking for answers? Try searching our database.

Concurrency

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bud J - 09 Oct 2005 08:29 GMT
i've been researching concurrency issues with ado .net for the past few days
and have found some trouble finding examples that suit my needs.  Over and
over again the only two options i've found is either save the your changes
(DataRowVersion.Current) or don't (DataRowVersion.Original). Well neither of
those really fit.  if jon changes the lastname of an employee and jack
changes the firstname then i want jon and jack's changes not either or.
Currently, i catch the dbconcurrencyexception(timestamp used to generate this)
and use the "id"  of the row to send a statement back to the database so i
can compare the dbvalues for each field to the datasetvalues and comparing
the two will accomodate my jon and jack scenario.  this all works fine but it
seems to me that sending back another statement is excessive at best. any
suggestions?

fyi
i use stored procedures for everthing(select,add,delete,changes)
i never use the commandbuilder and never will so no responses pertaining to
it please
Miha Markic [MVP C#] - 19 Oct 2005 12:52 GMT
Hi Bud,

If you have timestamp field, you might do something like
"update SomeTable set bla bla where Id=@Id and TimeStampField = @TimeStamp"
and pass DataRowVersion.Original values of time stamp to @TimeStamp
parateter and id to @id.
So, if there are no changes, then something went wrong (somebody modifed the
record).
If you want also to refresh the timestamp after the update, you'll do
something like:
"update SomeTable set bla bla where Id=@Id and TimeStampField = @TimeStamp;
Select @TimeStamp where Id=@Id"
The question is if you are using a DataAdapter or Command object?

Signature

Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

> i've been researching concurrency issues with ado .net for the past few
> days
[quoted text clipped - 18 lines]
> to
> it please
Bud J - 21 Oct 2005 01:25 GMT
thanks for the reply

i've researched this a bit more since originally posting and discovered the
only solution is the one i currently have in place.  i really wish there was
a more direct way but no luck

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.