ObjectSharp Blogs

You are currently viewing

DataSet FAQ

The Place to Go for DataSets


Accessing Delete Row Information

I recently had the need to access the information in a row marked as “Deleted“ in a DataSet as part of the update process.  The first attempted netted a DeletedRowInaccessibleException exception.  It is not possible to access the current information for a data row once the row has been deleted. 

However, the very notion that there is 'current' information is a clue to the solution.  If it were possible to specify the version of the information to be retrieve, then it would be possible to use the original information.  As it turns out, this can be done through the indexer on a DataRow.  While the normal access mechanism for a DataRow would be

row[”ColumnName”]

to retrieve the original information in a deleted row, the desired version must be specified, as seen here

row[”ColumnName”, DataRowVersion.Original]

Comments

  • datasetfaq January 29, 2005 11:08 PM

    Excellent item to note, this sovled a problem I was having in trying to retrieve information for a deleted row in a dataset.

  • datasetfaq June 22, 2005 11:29 PM

    Great Stuff! The programming community rocks!

  • datasetfaq August 23, 2005 4:24 PM

    IT DOESN'T WORK, SHIT!!!

  • datasetfaq October 12, 2005 4:44 AM

    If it doesnt work for you, try:

    Row(0).Item("ColumnName", DataRowVersion.Original)

Anonymous comments are disabled