By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,340 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

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

P: n/a
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 ???
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

==============================
"Joao Santa Barbara" <jo****@i24potugal.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl...
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 ???

Jul 19 '05 #2

P: n/a
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.
__________________________________

"Joao Santa Barbara" <jo****@i24potugal.com> wrote in message
news:Ol**************@TK2MSFTNGP12.phx.gbl...
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 ???

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.