Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2013

    Unanswered: Concurrency violation

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

    I am getting this error in my test program.
    I also have a MySql database with the same schema and I do not get the error.
    This appears to be a Npgsql.dll error. I tried (2) versions with the same result (2.1.3 and 2.2.3)
    If I do a NpgsqlCommand SQL Update, it works.

    Should this be submitted as a Npgsql bug?

    partno is the primary key.

        Public Sub update_record()
            sel_partno = "AAA"
            sql = "SELECT partno,pl_status,pl_rel_by,pl_rel_date FROM part_master_eng WHERE partno = '" & sel_partno & "'"
            DataAdapter_pm = New NpgsqlDataAdapter(sql, conn)
            cb = New NpgsqlCommandBuilder(DataAdapter_pm)
            ds_pm = New DataSet()
            Dim myRow As DataRow
            myRow = ds_pm.Tables(0).Rows(0)
            myRow("pl_status") = "Released"
            myRow("pl_rel_by") = "Test"  'emp.login
            myRow("pl_rel_date") = Now
            DataAdapter_pm.UpdateCommand = cb.GetUpdateCommand
            conn.Close() : conn = Nothing
        End Sub

  2. #2
    Join Date
    Sep 2013
    I found a workaround for the issue, but I don't understand why it fixes the problem.
    There is a field pl_status character(14), not null, Default 'Modified'::bpchar;
    I changed it to varchar(14) and the problem went away!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts