473,545 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to handle deleted rows?

I have two tables in the dataset:
-Invoice header which contains invoice total (Parent table)
-Invoice line which contains line item details (Child table)

I am using a data adapter to update the actual database
There are appropriate table relations

Here is the problem: If I delete a row from the Invoice_line I want to
recalculate the invoice total. I use a loop to recalculate the total line
item cost using the code below:, but I get an error (Deleted row information
cannot be accessed through the row). How can I loop thru the active records
without getting this error? I have tried using GetChildRows("i nvoice_table",
DataRowVersion. Proposed), but I get the error (There is no Proposed data to
access.).

If I use DatasetAll.Acce ptChanges right after doing the delete, I don't get
the error, but then the OledbDataAdapte r.Update does not do the
update/delete.

Code:
invoice_total = 0

' if a line is deleted this fails with an error due to no version

For Each child In Parent.GetChild Rows("invoice_t able")

invoice_total = invoice_total + (child("qty") *
child("unit_cos t"))

Next child

OleDbDataAdapte r1.Update(DataS etAll1)

OleDbDataAdapte r2.Update(DataS etAll1)


Nov 20 '05 #1
1 1266
Cor
Hi Ray,

Not that I see it clear, but why is this not?

OleDbDataAdapte r1.Update(DataS etAll1,"parentT able")
OleDbDataAdapte r2.Update(DataS etAll1,"childTa ble")

Cor
Nov 20 '05 #2

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

Similar topics

1
7847
by: iam247 | last post by:
Hi I am a relative beginner with SQL and ASP. With some help after previous posts I have a page which successfully requests querystrings from another page and deletes a record from an access table, However, I get the error message: "Row handle referred to a deleted row or a row marked for deletion" I am using access 2002, the table...
2
2391
by: raffe | last post by:
Hi all. I'm struggeling with a problem. I trying to do something very simple. I have a DataSet containing two tables TableA and TableB. I use TableA.GetChildren("relationName") in order to get an DataRow array containing all children rows of TableA in TableB. Then I'm sending the DataRow array as parameter into a DataAdapter.Update...
5
4481
by: Albert | last post by:
Does anyone know if it is possible to get information out of a datarow which has been deleted? Thanks, Albert
3
1458
by: Zorpiedoman | last post by:
Is this true: An existing row in a data table that is deleted still exists in the rows collection, but it is marked as deleted (rowstate = deleted) But If a row that was added to the data table, but not committed by accepting changes, is then deleted, it is actually removed from the data table's rows collection?
2
2516
by: Russell Smith | last post by:
Postgresql 7.4.5 The following VACUUMs were run within a couple of minutes of each other completing. This table concerned is a table that has not been changed in a long time. (a month) There were open transactions at the time the vacuum was run. These were created by having PHP running with postgresql. At least that is what I have managed...
4
7877
by: Joris De Groote | last post by:
Hi, (my code is @ the bottom of this message) I have a piece of code that runs the rows of a dataset until it finds the one needed. When he finds it, I delete that row and start all over again with the next row I'm looking for, however. I then get this error: System.Data.DeletedRowInaccessibleException: Deleted row information cannot be...
2
35508
weaknessforcats
by: weaknessforcats | last post by:
Handle Classes Handle classes, also called Envelope or Cheshire Cat classes, are part of the Bridge design pattern. The objective of the Bridge pattern is to separate the abstraction from the implementation so the two can vary independently. Handle classes usually contain a pointer to the object implementation. The Handle object is used...
4
25976
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I'm working in Visual Studio 2005 and C#. I have a DataTable with many rows. The user can delete a row. After the row is deleted, I'd like to column values for the deleted row, but any attempt to access column values results in the following exception: {"Deleted row information cannot be accessed through the row."} My understanding is...
0
1622
by: ZSvedic | last post by:
Hi all, I need to display DataRows with RowState.Deleted inside DataGridView, in a way that such rows have strikethrough font. Here is the screenshot how it should look like: http://www.svedic.org/DeletedRows.JPG The screenshot is from some unrelated C++ application with closed source, I want to achieve similar thing in .NET/WinForms.
0
7490
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7682
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7780
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6009
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5351
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5069
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3465
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1037
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.