473,503 Members | 12,791 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error calculating aggregate value over children with rowstate 'Add

I have an Expression based DataColumn that is defined to calculate the Qty
sum of all child rows, based on a self-referencing relationship (i.e.
Parent.aggregateQty = sum(Child(linkedRelationship).Qty) where both Parent
and Children are entries to the same DataTable.

I'm finding that if I create a new Child row and link it to a pre-existing
Parent, the next time I trigger an update event on that Parent row I get a
Error:

"An unhandled exception of type 'System.Data.VersionNotFoundException'
occurred.
Additional information: There is no Original data to access."

It appears that if the Parent rowState != 'Added', then it expects to find
an Original version value in each linked Child, throwing an exception when it
encounters the 'Added' child.

I can avoid the error by adding the child with a LoadDataRow command,
passing AcceptChanges = 'true', as this creates the row in an 'unmodified'
state. But this messes up the data update logic later on which relies on the
'added' state to call the correct stored procedure.

Any suggestions?
Jul 21 '05 #1
0 2067

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
282
by: Good Enchiladas | last post by:
While building on a class library for an VB.NET object model, I get something similar to the above error message, but not with C#. The steps to recreate the problem are as follows: 1. Build a...
1
1686
by: Supra | last post by:
i got "system error" when saving to xml file. i am using checkbox1 control to xml. when user clicked checkbox and set to true and press btnOk to conform and save it to xml ...
3
1943
by: koperenkogel | last post by:
Dear cpp-ians, I have a vector of structures: struct meta_group { float id; float num; float mean; float sum;
0
1298
by: Supra | last post by:
i got "system error" when saving to xml file. i am using checkbox1 control to xml. when user clicked checkbox and set to true and press btnOk to conform and save it to xml ...
10
1680
by: Chris Baxter | last post by:
In my program I am trying to do a simple calculation of 5.1 * 100 which should =510 if my gradeschool level math is correct. My problem is vb.net is returning 509.99999999999994 as the answer. Am...
0
296
by: TEbert | last post by:
I have an Expression based DataColumn that is defined to calculate the Qty sum of all child rows, based on a self-referencing relationship (i.e. Parent.aggregateQty =...
5
3695
by: David Garamond | last post by:
What do people think of adding some more aggregate functions. These are the ones that MySQL has and PG doesn't: - STD/STDDEV - VARIANCE - BIT_OR - BIT_AND - GROUP_CONCAT (for strings, added...
0
2364
by: abrosey | last post by:
The error is surrounded in stars near the bottom of the code, any help would be appreciated! namespace USDP.eCFUtilities { /// <summary> /// Summary description for CatalogHelper ///...
5
2349
by: codefragment | last post by:
Hi I have a dataset which holds (amongest other things) a string. - The dataset gets loaded from the database via a middle tier - The string value contains "\r\n" - Its serialised to the web...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1524
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.