PC Review


Reply
Thread Tools Rate Thread

CommandBuilder Problem

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


 
Reply With Quote
 
 
 
 
William Ryan
Guest
Posts: n/a
 
      26th Aug 2003
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
>-----Original Message-----
>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
>
>
>.
>

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





"William Ryan" <(E-Mail Removed)> wrote in message
news:0ddb01c36bd9$09eb59c0$(E-Mail Removed)...
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
>-----Original Message-----
>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
>
>
>.
>



 
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 Problem Wayne Wengert Microsoft ADO .NET 4 26th Sep 2005 03:34 PM
Done with CommandBuilder tascienu@ecoaches.com Microsoft ADO .NET 5 12th Sep 2005 08:41 AM
CommandBuilder problem. Is it broken? vb.net2003. Jeremy Microsoft VB .NET 1 15th May 2005 12:21 AM
CommandBuilder Antonio Prieto Microsoft ADO .NET 5 23rd Nov 2004 11:09 AM
little problem replacing commandbuilder =?Utf-8?B?S2Vu?= Microsoft ADO .NET 1 15th Nov 2004 11:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:15 AM.