Is it possible to work with commandbuilder and with a Autonumber Field

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

Joao Santa Barbara

Hi all i have a table with an autonumber field

with a based select , i want to get all the three others commands,

my problem is, i have a ds and i want to insert a new row ( my database
gives a new id to that row, it the pk )
after i insert the row, i have watched the DS for my ID, and i can´t find
the correct one. ( if i doesn´t find the correct one how can i make changes
to the currentrow )
what is going wrong with the CommandBuilder ...

after a have inserted the new row i try to change a column value and it
throws a concurrency exception ..

why ????

thks
JSB

PS: does anyone have a sample for this ???
 
Why are you using an autonumber field if the DB is allocating the number
itself. When inserting a new row, use -1 for the PK and your db should
allocate the correct new ID and you wont get this concurrency error.



--
Regards - One Handed Man

Author : Fish .NET & Keep .NET

==============================
 
See my article on the Command builder and the identity issues at
http://www.betav.com/msdn_magazine.htm


--
____________________________________
Bill Vaughn
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top