Re: Design question
From: CJ Taylor (youalreadyknowit_at_itsoneverylistintheworld.com)
Date: 02/26/04
- Next message: CJ Taylor: "Re: Self updating applications"
- Previous message: Jay B. Harlow [MVP - Outlook]: "Re: Character Escapes Don't Work in VB Regex Replace?"
- In reply to: CJ Taylor: "Re: Design question"
- Next in thread: Bryan Martin: "Re: Design question"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 26 Feb 2004 01:43:58 GMT
Nevermind... bad idea.
"CJ Taylor" <nospam@blowgoats.com> wrote in message
news:103q50g871gk32c@corp.supernews.com...
> if your using DataAdapters (properly) you can catch the RowUpdated Event
and
> see if it was successful or not...
>
> if it wasnt, you can get the new value by retreviing it from the
database...
>
> [excerpt from David Sceppa's book]
> <code>
> Private Sub HandleRowUpdated (byval sender as object, e as _
> OleDbRowUpdatedEventArgs)
>
> If e.Status = UpdateStatus.ErrorsOccurred AndAlso _
> TypeOf(e.Errors) is DBConcurrencyException then
>
> ConflictAdapter.SelectCommand.Parameters(0).Value = e.Row("ID")
> Dim intRowsReturned as Integer
> intRowsReturned = ConflictAdapter.Fill(ConflictDataset)
> if intRowsreturned = 1 then
> e.Row.RowError = "The row has been modified by another user"
> 'CJ's note: Here you can do a bunch of stuff saying what
> actually changed
> else
> e.Row.RowError = "The row no longer exists in database"
> end if
> e.Status = UpdateStatus.Continue
> end if
> End sub
>
> hope it helps
> CJ
>
>
> End Sub
> </code>
> "Ruslan Shlain" <rshlain@hotmail.com> wrote in message
> news:OZJC1L%23%23DHA.3668@TK2MSFTNGP09.phx.gbl...
> >
> > Hello Everyone,
> > Looking for a better way to do this.
> >
> > I have several separate processes running on 5 + machines on the
network.
> > These processes are identical. What they do is, they look at a table in
> the
> > DB and based on entries they perform some tasks.Once entry is read it
> > changes a status. My problem consits of the following. If 2 processes
read
> > an entry from the table at the same time and one of them changes it
status
> > and then the other comes in and changes same entry they both will be
> working
> > on the same task. Is there a way that i can force "something ", so that
> > above scenerio happens 2 of my processes do not work on the same entry.
> > --
> > Ruslan Shlain
> > nAlliance Corporation
> > www.nAlliance.com
> >
> >
>
>
- Next message: CJ Taylor: "Re: Self updating applications"
- Previous message: Jay B. Harlow [MVP - Outlook]: "Re: Character Escapes Don't Work in VB Regex Replace?"
- In reply to: CJ Taylor: "Re: Design question"
- Next in thread: Bryan Martin: "Re: Design question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|