PC Review


Reply
Thread Tools Rate Thread

Concurrency violation problem.

 
 
=?Utf-8?B?cGFjaHV0cw==?=
Guest
Posts: n/a
 
      20th Jun 2007
Hi,

Using ADO.NET Table adapter in C# , am updating a record using VS2005
generated update command by passing dataset and the assocaited table like;
this.CustomerDataSet.CustomerTable.

while updating am getting "Concurrency violation: the UpdateCommand affected
0 of the expected 1 records.".

Any help on this would be appreciated,

Thanks,
Pachu
 
Reply With Quote
 
 
 
 
Petar Repac
Guest
Posts: n/a
 
      21st Jun 2007
Well, it seems like UPDATE command did not found a record to process.
When doing update DataAdapter sends UPDATE command to database and after
UPDATE has performed it asks DB "how many records did I update".

In this case DB says zero, and DataAdapter raised an exception.
Because it thinks that the reason for 0 updated records is that some
other client/session has deleted the record you wanted to update it
raises "Concurrency violation", but in fact the reason could be badly
written UPDATE command (look at the WHERE clause) or the fact that this
record never existed in DB.

Hope it helps,
Petar Repac

pachuts wrote:
> Hi,
>
> Using ADO.NET Table adapter in C# , am updating a record using VS2005
> generated update command by passing dataset and the assocaited table like;
> this.CustomerDataSet.CustomerTable.
>
> while updating am getting "Concurrency violation: the UpdateCommand affected
> 0 of the expected 1 records.".
>
> Any help on this would be appreciated,
>
> Thanks,
> Pachu


 
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
Concurrency violation problem Agnes Microsoft VB .NET 0 6th Oct 2004 10:32 AM
Concurrency Violation Nathan Microsoft ADO .NET 2 25th Jan 2004 11:20 PM
Concurrency violation: Problem dynamically creating DataAdapter commands sam Microsoft ADO .NET 2 26th Aug 2003 05:42 PM
another dreaded Concurrency Violation problem maxhodges Microsoft ADO .NET 1 28th Jul 2003 07:45 PM
Concurrency Violation Hill Cheung Microsoft ADO .NET 1 4th Jul 2003 09:04 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:26 AM.