Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / April 2006

Tip: Looking for answers? Try searching our database.

The DeleteCommand affected 0 records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
s.bussing@symax.nl - 10 Apr 2006 20:20 GMT
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
s.bussing@symax.nl - 10 Apr 2006 20:34 GMT
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?
Cor Ligthert [MVP] - 11 Apr 2006 06:24 GMT
Hi,

This is an often handled problem in this newsgroup.

Can you have a look for yourself?

http://groups.google.com/group/microsoft.public.dotnet.framework.adonet/search?g
roup=microsoft.public.dotnet.framework.adonet&q=UpdateCommand+affected+0+records
&qt_g=1&searchnow=Search+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

> 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
[quoted text clipped - 25 lines]
>
> Thx

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.