Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2006, 07:03 AM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default DeletedRowInaccessibleException

I just wanted to post a better answer on an issue that was mentioned in one of the locked forum entries:
http://p2p.wrox.com/topic.asp?TOPIC_ID=9049

This is a complaint about the inability to access a Deleted row in a DataTable, even to get its key values to build a SQL DELETE statement.

A solution to this (and the correct one, I think), at least in VS2005, is to set the RowVersion you want.

E.G. if "row" is deleted:
string key = row["KeyColumnName"] -- does not work and causes DeletedRowInaccessibleException.

string key = row["KeyColumnName", DataRowVersion.Original] -- does correctly work without errors.

Hope this helps someone. Took me a bit to figure it out. Makes sense that you can only access the original values of a deleted row, since it does not have any current values.










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.