HighTechTalks DotNet Forums  

Viewing deleted rows in a dataset

Dotnet Data Tools microsoft.public.dotnet.datatools


Discuss Viewing deleted rows in a dataset in the Dotnet Data Tools forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Viewing deleted rows in a dataset - 07-13-2004 , 10:36 AM






My application has a save button that the user must press before
changes in the DataSet are committed to the database.

I am using the Delete() method to delete rows fromt the DataSet.

I am having trouble reading columns from rows whose row state is
Deleted in the DataSet that is returned by the GetChanges() method. I
have also tried using the Select() method and specifying the rows
returned should have a Deleted row state.

In both cases I get the following exception when trying to access any
column in the rows returned:

An unhandled exception of type
'System.Data.DeletedRowInaccessibleException' occurred in
system.data.dll

Additional information: Deleted row information cannot be accessed
through the row.

Does anyone know of a simple way to access these deleted rows?


Thanks,
Fred

Reply With Quote
  #2  
Old   
chrisrock
 
Posts: n/a

Default RE: Viewing deleted rows in a dataset - 08-03-2004 , 07:15 PM






When you access the datarow use:
DataRow.Item("itemname", DataRowVersion.Original)


"Fred Chen" wrote:

Quote:
My application has a save button that the user must press before
changes in the DataSet are committed to the database.

I am using the Delete() method to delete rows fromt the DataSet.

I am having trouble reading columns from rows whose row state is
Deleted in the DataSet that is returned by the GetChanges() method. I
have also tried using the Select() method and specifying the rows
returned should have a Deleted row state.

In both cases I get the following exception when trying to access any
column in the rows returned:

An unhandled exception of type
'System.Data.DeletedRowInaccessibleException' occurred in
system.data.dll

Additional information: Deleted row information cannot be accessed
through the row.

Does anyone know of a simple way to access these deleted rows?


Thanks,
Fred


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.