PC Review


Reply
Thread Tools Rate Thread

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

 
 
Joao Santa Barbara
Guest
Posts: n/a
 
      26th Aug 2003
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 ???


 
Reply With Quote
 
 
 
 
One Handed Man
Guest
Posts: n/a
 
      26th Aug 2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 ???
>
>



 
Reply With Quote
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      26th Aug 2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 ???
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CommandBuilder and Identity Field =?Utf-8?B?RGFuaWVsZSBQaW5haQ==?= Microsoft ADO .NET 1 27th Sep 2006 02:11 PM
How to work with commandbuilder and transactions ????? Joao Santa Barbara Microsoft ADO .NET 10 9th Sep 2003 09:20 AM
How to work with commandbuilder and transactions ????? Joao Santa Barbara Microsoft VB .NET 10 9th Sep 2003 09:20 AM
How to work with commandbuilder and transactions ????? Joao Santa Barbara Microsoft Dot NET 10 9th Sep 2003 09:20 AM
Is it possible to work with commandbuilder and with a Autonumber Field Joao Santa Barbara Microsoft Dot NET 2 26th Aug 2003 08:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:58 PM.