473,386 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
2 2262
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Joao Santa Barbara | last post by:
hi all i need to work with the commandbuilder and with a transaction object how can i do this ???? thks JSB please don´t tell me that i have to do this ex:
2
by: hch | last post by:
dataAdapter.Update(data, "TableName") won’t work! I was about to deploy my first website on the Internet only to discover that the dataAdapter.Update() throws the Server Error in the third...
4
by: Don Seckler | last post by:
I am building an application to track the distribution and returns of copies of magazines. Copies of a magazine that are unsold are returned by the retailer to the wholesaler. They are...
21
by: Dan | last post by:
Hi, just ran into my first instance of a backend Access97 database not compacting. I'm getting the "MSACCESS.EXE has generated errors.." message on compact. I've narrowed it down to the largest...
7
by: Amy | last post by:
I'm trying to add an autoincrementing id to a table based on an existing field Name, but Name has duplicated records. How can I do that in ACCESS? Thanks. Amy
0
by: Georges Heinesch | last post by:
Hi. I have a primary key field in a table defined as AutoNumber Random. I'd like to know whether it's possible that Access the number 0 (zero) to this field? I.a.w., is 0 (zero) part of the...
1
by: Jeremy | last post by:
When executing myda.update(myds,"cert"). I get the message "The field 'Cert.DateofInspection' cannot contain a Null value because the Required property for this field is set to True. Enter a...
2
by: Joao Santa Barbara | last post by:
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...
10
by: MLH | last post by:
Suppose, in a multi-user environment, you have append query SQL in a VBA procedure that looks like INSERT INTO MyTable... and the next line reads MyVar=DMax("","MyTable... You can never be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.