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?
--
Miha Markic [MVP C#]
RightHand .NET consulting & development
www.rthand.com Blog:
http://cs.rthand.com/blogs/blog_with_righthand/ [quoted text, click to view] "Bud J via DotNetMonster.com" <u9718@uwe> wrote in message
news:5591d6c109cac@uwe...
> 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
>
>
> --
> Message posted via DotNetMonster.com
>
http://www.dotnetmonster.com/Uwe/Forums.aspx/winform-data-binding/200510/1