in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Concurrency Violoation on update

Last post 06-21-2006 8:27 AM by xhenxhe. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 06-15-2006 2:25 PM

    Concurrency Violoation on update

    I've got a SQLite db set up as follows:

    create table processes (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        name varchar,
        source varchar,
        destination varchar,
        copy bool,
        copy_folder varchar,
        delete_days int,
        created datetime,
        modified datetime
    );

    I have a DataSet (dsProcesses), BindingSource (ProcessesBindingSource), and a TableAdapter (ProcessesTableAdapter). When I try to edit a row and write the data back to the database using this code (VB.NET):

    Me.ProcessesBindingSource.EndEdit()
    Me.ProcessesTableAdapter.Update(Me.DsProcesses)


    I get the following error:

    Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.

    Any ideas on why it won't write the changes back to the database?

    Thanks,
    Dustin
  • 06-15-2006 9:25 PM In reply to

    Re: Concurrency Violoation on update

    Hrm.  I'll see if I can duplicate the error locally.  If not, I may need you to send me a sample app so I can debug it.

    Robert

     

  • 06-19-2006 2:48 PM In reply to

    Re: Concurrency Violoation on update

    Any luck on this? Do you want all the code?
  • 06-19-2006 7:40 PM In reply to

    Re: Concurrency Violoation on update

    I haven't had time to try it out yet.  I just got back from vacation with the family :) 

    Robert

     

  • 06-21-2006 5:51 AM In reply to

    • alex
    • Top 50 Contributor
    • Joined on 02-07-2006
    • Posts 26

    Re: Concurrency Violoation on update

    Hi,

    looks like "Optimistic Concurrency" is turned on in your TableAdapter. Try to turn it off under "Advanced Options..." in the
    TableAdapter Configuration Wizard.

    Also, Google-ing for your error message returns numerous helpful links.


    Regards,
    Alexander

  • 06-21-2006 8:27 AM In reply to

    Re: Concurrency Violoation on update

    I found the issue. There was a field on my form that would sometimes contain a string value when it should alwasy be an integer value.

    Sorry! Thanks for the help.
Page 1 of 1 (6 items)
Powered by Community Server (Commercial Edition), by Telligent Systems