PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET The DeleteCommand affected 0 records

Reply

The DeleteCommand affected 0 records

 
Thread Tools Rate Thread
Old 10-04-2006, 08:20 PM   #1
s.bussing@symax.nl
Guest
 
Posts: n/a
Default The DeleteCommand affected 0 records


Hi, as many before me, and probably after me, I recieved the following
error when I try to update my table using a typed dataset which
contains serveral tables.

The Delete/UpdateCommand affected 0 records

All my tables are related and all relationships are configured. For
simplicity I'm going to stick to two table. Parent and child. The
relationsship is defined with a cascading delete. So if I delete a row
in the parent, the child row is also marked as deleted. This is where
the problem starts. Booth tables have a dataadapter in which the
SQL-statements (MS SQL) are defined. When I the adapter of the child
table is executed (this is after the dataadapter of the parent
executed) I recieve the error as described in the subject. But when I
just delete the child directly, it is deleted without any errors.

I'm the only one working with (testing) the program, so there is no
possibility anyone else changed the record while I was working on it.

So, when I delete the row in the childtable directly, no problem. When
the row is deleted through a cascading delete (via the parenttable) I
recieve an error when the dataadapter of the childtable executes the
updatestatement.

What am I doing wrong?

During the configuration of the adapters I used Optimistic Concurrency.

Thx

  Reply With Quote
Old 10-04-2006, 08:34 PM   #2
s.bussing@symax.nl
Guest
 
Posts: n/a
Default Re: The DeleteCommand affected 0 records

I was thinking, maybe if the delete of the child is caused by a
cascading delete of the parent, the original row values of the child
are lost so the deletestatement of the DataAdapter update-method
doesn't work anymore.

Could this be the problem?

  Reply With Quote
Old 11-04-2006, 06:24 AM   #3
Cor Ligthert [MVP]
Guest
 
Posts: n/a
Default Re: The DeleteCommand affected 0 records

Hi,

This is an often handled problem in this newsgroup.

Can you have a look for yourself?

http://groups.google.com/group/micr...arch+this+group

There are of course more threads this is about Update, I thoutht that about
delete it is even more.

I hope it helps something

Cor

<s.bussing@symax.nl> schreef in bericht
news:1144696818.727505.46760@e56g2000cwe.googlegroups.com...
> Hi, as many before me, and probably after me, I recieved the following
> error when I try to update my table using a typed dataset which
> contains serveral tables.
>
> The Delete/UpdateCommand affected 0 records
>
> All my tables are related and all relationships are configured. For
> simplicity I'm going to stick to two table. Parent and child. The
> relationsship is defined with a cascading delete. So if I delete a row
> in the parent, the child row is also marked as deleted. This is where
> the problem starts. Booth tables have a dataadapter in which the
> SQL-statements (MS SQL) are defined. When I the adapter of the child
> table is executed (this is after the dataadapter of the parent
> executed) I recieve the error as described in the subject. But when I
> just delete the child directly, it is deleted without any errors.
>
> I'm the only one working with (testing) the program, so there is no
> possibility anyone else changed the record while I was working on it.
>
> So, when I delete the row in the childtable directly, no problem. When
> the row is deleted through a cascading delete (via the parenttable) I
> recieve an error when the dataadapter of the childtable executes the
> updatestatement.
>
> What am I doing wrong?
>
> During the configuration of the adapters I used Optimistic Concurrency.
>
> Thx
>



  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off