CommandBuilder Problem

  • Thread starter Thread starter Joao Santa Barbara
  • Start date Start date
J

Joao Santa Barbara

Hi all
i have a problem with my command builder

i have made a commandbuild to get the insert, delete and update querys.
i´m using a table with a autonumber, so i have fill my dataset with this
query
select * from test_table1

this table has 3 fields
ID ( autonumber)
Code( Varchar)
Description(Varchar)

so after i have inserted a new row, i update the database, and in the same
row i change a value ( ex description ) and save it again it throws a
exception "Concurrency violation "

i know that the problem is in the autonumber but i don´t want to make all
querys by hand .


how can i solve this ...

thks

JSB
 
Try setting the autoincrement value of the PrimaryKey
column to -1. If you are using an autonumber, it's
possible that it's value is the same as the one the DB is
tryting to add, by using a negative number, that won't
happen and it'll be assigned correctly in the db.

Good Luck,

Bill
 
hi there thks for the reply

but i think that the problem is not the pk column, but the refresh of the pk
column
i have analising the commandbuilder, and it should do after the insert a
select to the inserted row asking what is the key .
and the commandbuilder doesn´t do that ..



thks
JSB





Try setting the autoincrement value of the PrimaryKey
column to -1. If you are using an autonumber, it's
possible that it's value is the same as the one the DB is
tryting to add, by using a negative number, that won't
happen and it'll be assigned correctly in the db.

Good Luck,

Bill
 
Back
Top