Deleted row information cannot be accessed through the row.

I'm getting an exception with the message "Deleted row information cannot be accessed through the row".

I have processing the records through the data table. In some situation i have deleted the rows in the datatable and inserting the new rows. These situation i have get the above specified error.

Regards,

Vijay

0
vijay_
6/20/2008 9:31:28 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

4 Replies
1360 Views

Similar Articles

[PageSpeed] 3

Hi Vijay,

this error occours when u try to access the row which u have already deleted. So, try to check if the row exists or not and then retrieve the information.

I hope this will help u..


Please mark as Answer if it helps u. Thanks!

Parth Patel
Techsture Technologies
Software Developer
Ahmedabad
0
Coool
6/21/2008 6:39:07 AM

If you wish to access information on the row that is being deleted, try doing is in the datagrids rowdeleting event. This event fires before the row is deleted from the database.


ASBESTOS Greetings
0
jdstuart
6/21/2008 7:15:59 AM

Hi,

Use Datatable.Acceptchanges() after you have deleted the row and  before you access a row.

regards,

varun

0
Varun
6/21/2008 5:15:12 PM

Hi vijay_.net,

If the DataRow.Delete method is called, the row transitions such that its RowState is DataRowState.Deleted.
(It is only acutally removed from the DataTable when AcceptChanges is called.)
When a row is in DataRowState.Deleted, the normal means for accessing the values do not work (as you have seen). 
If all you need to know is that the row is deleted, check the RowState property. 
If you need to retrieve the "original", deleted data, you can use an overload of he Item property. 
For example, if dr is your row, dr("MyColumnName", DataRowVersion.Original) returns the old value. 
(Similarly, dr.IsNull("MyColumnName", DataRowVersion.Original) can be used to check the original data for null).

Detail information is disaplyed at the following link.

http://forums.msdn.microsoft.com/zh-CN/vblanguage/thread/d012dc3a-5cb2-4fdc-8aaf-08c69d2ffa0b/


Let me know if I have misunderstood what you mean.
Thanks.
Hope it helps,
Hua Jun

 


Sincerely,
Hua Jun Li
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Hua
6/23/2008 9:12:28 AM
Reply:

Similar Artilces:

"Deleted row information cannot be accessed through the row." WHY!!
hi guys, I have a problem with my datagrid. My form is set up so I have two textboxes an add button and an editable datagrid. The datagrid is bound to a datatable which is in my cache.When I click the add button the contents of the textboxes are insertedinto the datatabel in teh cache and the datagrid is bound to it. However the problem comes when I delete a row from the database and then add and edit a row. Lets say my datagrid has only one row, I delete it and then insert a new row. WHen I click on the Edit button of the new row that has been inserted I get the following error Delet...

accessing row by row
first of all sorry if i posted this in a wrong place but i'm new to powerbuilder and i have to develop a program quite quickly ( i only worked with acces until now) i have been provided a excel spreadsheet that contains all coloms and rows from all tables wich i have to insert in a database. The difficulty is that i can't use a datapipeline because i need to use a string function to check in wich table i have to put it: TABLENAME_COLUMNNAME -> i thought about using the string function to find out the right column in the right database. however i don't know how you ...

adding / deleting table rows, and accessing controls within added rows
Hi everyone,I would like to know what is a good and simple way to achieve this using asp.net.  Basically i would like the ability to add and delete rows, preferably table rows.  Against each row is its delete button, hitting it will delete the corresponding row.  There is only 1 Add button to add a new row.  In each row, there are say 2 textboxes.  When i hit, say a calculate button, i wish to be able to access all the available textboxes in all the available rows in the event handler, and say just output a sum.If GridView is suggested, could you please explain why i...

Value in Web Form to Delete Database Row
Hi everyone,I have a problem and was hoping someone might be able to help me with it.Basically I have a label control that displays an ID number. I also have an MS SQL database with a table called Images with a primary key called ID. What I need to do is dependent upon the label control value delete the corresponding row in the database table.e.g. Label Value in web form = 4. So from this I need to delete the row in the Database which has the Primary key ID = 4.I am coding in VB as I don't know any C#. Any help greatly appreciated.ThanksDaniel  Dan_no7: Hi everyone, I have a p...

Delete Row Method (getting the primarykey of row being deleted)
Hello friends,I'd like to retrieve the primary key of the row being deleted so i can use it as a parameter in my stored procedure: Here's how far i have come with my code. I need help with line 6.Thanks in advance :)  1 Protected Sub DependentsObjectDataSource_Deleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs) Handles DependentsObjectDataSource.Deleting2 3 'get value of deleting depednent id4 'Delete (Unenroll) all benefits dependent enrolled in before attempting to delete dependen...

Delete row removes all rows
When datawindow row 1 is clicked and selected then a pfc_deleterow is issued all dw rows are deleted. dw_1 update spec is "update", not delete then insert. Only one key column on the table which is a serial column. ll_rtn = dw_1.event pfc_DeleteRow() ll_rtn count does indicate that all rows were deleted. If any other row is selected then only the selected row is deleted. When the window is 1st opened and row one is displayed but not selected, only row 1 is deleted. Is this the expected behavior? PB 7.02 8046, NT 4.0, and the corresponding version of SQLAnywhere (whate...

vs.net web forms wysiwyg resize row problem
I don't know if someone ever when throw this problem, but something weird is happening with the wysiwyg from web forms of .net, the problem is the following: sometimes when i'm selecting a control in the HTML mode it selects to resize the row by mistake, the resize mouse pointer appears and i click to drop the resize mode, but then i'm not allowed to go outside of the table that i resized the row even dropping the resize mode, i try to change to code mode, and it allows to go beond the table but when i get cack to HTML mode it doesm't i'm forced to restart the vs.net, this is quite anoyng...

First Row, Next Row, Prior Row, Last Row
I have a SQL Anywhere 7.0 Database, have a table Product_detail which contains Column Name Datatype width Null Default batch_id char(10) No None prod_id Integer No None employee_id Integer No None quantity Integer No None price Numeric (14, 2) No None Its primary key is batch_id I have a Freeform Datawindow with this table I want to provide the first row, next row, prior row and last row Ho...

Accessing GridView Data Row By Row
guys i have just started with asp.net i have a basic doubt, i have created a SQL datasource and a gridview associated with it now what i need to do is get all the data from my database n modify it further, for this i need to access each row of the gridview any ideas on how to do so? foreach(GridViewRow row in GridViewName.Rows) { you can interate like this..  }Better Post your code before asking some thing, some one. So that person helping u will understand u r problem ClearlyYahoo IM : dotnetrulerI am trying to keep Frequently Asked Questions in my blog  When u enable show...

Select a Row in DataGrid and Delete this Row
My goal is to put the Rows from one (left) GridView into the secend (right) GridVIew.For this I would like to use Drag and Drop becauce this would do just that but I can find only D&D features in e.g. Dojo. Is it possible in ASP.NET, too?Because I didn't find the D&D solution for ASP.NET I created two GridViews with a SELECT Label for choosing a Row. Then I chosen the SelectedIndexChanged event but when I want to delete the selected row then an error occurs that this isn't possible. Does anyone knows how I can solve my problem? Thank you!  Hello!!Plz see following lin...

How to delete Datagrid row if that row is not selected
Hi, I faced a problem. I have a simple datagrid. It allows user to select a particular row of data say row 5. It works completely fine but if user wants to delete row 7 when row 5 is selected, the datagrid will delete 5 (which is the selected row) instead of 7. How to go about this issue? Thanks! Regards, FrancisSGDOTNET.ORG Can't you just select row 7 and delete it?Thanks!Bernie At first, DataGrid deletes nothing. It sends out only commands that your code has to handle. You have to use DeleteCommand event of datagrid. In this event you have to take the row index from event...

Deleteing rows in Row level Locking
When deleting rows on tables that use row level locking (ASE 11.92) the number of rows effected is not returned. Is there a way to obtained the number of rows marked as delete. This was needed to help verify an automated process of cleaning up our daily mess in one application. thank you, gfessen glen.fessenden@globalcrossing.com wrote... > When deleting rows on tables that use row level locking (ASE 11.92) the > number of rows effected is not returned. Is there a way to obtained the > number of rows marked as delete. This was needed to help verify an automated > p...

GridView.Rows.Count after deleting rows
How do I get the count of GridView's data rows that is displaying?If I use GridView.Rows.Count, after deleting a row, it won't change - as same as before deleting, and nor do GridView.DataKeys.Count.  My blog (zh-CN)Be and awear of who you are. Most likely, you'll have to re-bind the data after the deletion. If so, go ahead and retrieve your count during the DataBound event, then you'll know you're retrieving an accurate count.Thanks, EdMicrosoft MVP - ASP/ASP.NET Yes, that's the easiest way to do this.I finally chose another way: in DataBound event, record the count, and in&nb...

Web resources about - Deleted row information cannot be accessed through the row. - asp.net.web-forms

Information - Wikipedia, the free encyclopedia
Information (shortened as info or info. ) is that which informs, i.e. an answer to a question, as well as that from which knowledge and data ...

InformationWeek – Latest Information Technology (IT) news & IT articles - Technology news - IT magazine ...
InformationWeek provides latest Information technology (IT) news online & articles and publishes latest tech news & IT magazine for Indian IT ...

ACT anti-domestic violence boss calls for better information sharing across sector
... ACT government will seek to strike a balance between victim safety with privacy concerns as it eyes better ways of sharing information ...

Queensland weather: Latest storm warning information
PARTS of Queensland were hit by severe storms, with golf-ball-size hail in the Granite Belt Monday afternoon.

Magnetic protein may provide animals with navigation information
What do monarch butterflies, salmon, lobsters, bats, mole rats, and marine nudibranch mollusks have in common? As I'm sure you already knew, ...

Apple’s secrets: How Apple’s legal fight with Samsung revealed a gold mine of top-secret information
Following a contentious patent battle that raged on for nearly five years, Samsung last week finally agreed to pay Apple $548 million in damages ...

Security researchers have discovered more information on how the Sony hackers managed to stay undetected ...
More details of the hack that wiped out Sony Pictures' computer systems and resulted in thousands of internal emails and documents leaking online ...

White House offers states more information on refugees
Governors are still clashing with the administration over whether to admit Syrian refugees into their states

VTech hack exposes personal information of millions of customers
Children's technology and educational toy maker VTech announced that it was recently a victim of a data breach that exposed sensitive information ...

VTech hack exposes personal information of 5 million adults and children
Another data breach? Won't someone please think of the children?

Resources last updated: 12/8/2015 12:58:46 AM