Re: Problems call DataAdapter.Update and Concurrency

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I also had Concurrency violation when updating an existing record. Check
the OleDbDataAdapter's UpdateCommand and the OleDbParameters used in that
command.

See my thread
http://groups.google.co.uk/group/microsoft.public.dotnet.framework.adonet/browse_frm/thread/4cf3fd3eabb5b85c/6102ad1bb75554ad
for how I solved it.

"Steve Lloyd" <steve.remove@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:OQt6RD%23MHHA.5064@xxxxxxxxxxxxxxxxxxxxxxx
Sorry, I did not call the .Fill correctly, it works if i do this, however,
the question still remains of whether this can be done without calling the
.fill and avoiding another trip to the database.

Thanks again

Steve

"Steve Lloyd" <steve.remove@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eWIId59MHHA.992@xxxxxxxxxxxxxxxxxxxxxxx
Hi all,

I wonder if anyone can explain what is happening here?
I have a dataadapter that I am using to correlate the changes in an SQL
Table to a DataTable. I create a new DataRow then call .Update and
acceptchanges, all works fine. The problem I have is when I try to amend
some of the data and the call the Update again. This time I get a
Concurrency error, which is understandable as the data has changed since
I initially created the table but is not the desired outcome and I was
expecting that after accepting changes can calling the .Fill the
concurrency conflict would be resolved.

Is there a way to get the adpater to update the changed rows. I have
tried calling .Fill after the update but this does not seem to help.
Ideally I would like to work on the datatable and not have to repopulate
from the database every time I update a cell/row.

Thanks for any help you can give.

Steve

Here is the code it use:
Try
_tradeAdapter.Update(_detailsTable)
_detailsTable.AcceptChanges()
_tradeAdapter.Fill(_detailsTable)
Catch exTran As DBConcurrencyException
MsgBox("There has been a conflict error on this trade, please refresh
your details and check", MsgBoxStyle.Critical, "Update Conflict")
s.Logging.ApplicationLog.LoggingLevels.ApplicationError)
End Try






.



Relevant Pages

  • Problems call DataAdapter.Update and Concurrency
    ... Concurrency error, which is understandable as the data has changed since I ... expecting that after accepting changes can calling the .Fill the concurrency ... calling .Fill after the update but this does not seem to help. ... MsgBox("There has been a conflict error on this trade, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Problems call DataAdapter.Update and Concurrency
    ... the question still remains of whether this can be done without calling the ... Concurrency error, which is understandable as the data has changed since I ... expecting that after accepting changes can calling the .Fill the ... MsgBox("There has been a conflict error on this trade, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Problems call DataAdapter.Update and Concurrency
    ... In my case only one user accesses the database. ... the question still remains of whether this can be done without calling ... Concurrency error, which is understandable as the data has changed ... MsgBox("There has been a conflict error on this trade, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Problems call DataAdapter.Update and Concurrency
    ... the question still remains of whether this can be done without calling the ... Concurrency error, which is understandable as the data has changed since ... MsgBox("There has been a conflict error on this trade, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Problems call DataAdapter.Update and Concurrency
    ... I use a command builder for update command as I want to make use of the ... as soon as the data gets changed it causes a concurrency violation. ... calling the .fill and avoiding another trip to the database. ... By default the DataAdapter will call AcceptChanges on each succesfull ...
    (microsoft.public.dotnet.framework.adonet)