|
-
Oct 24th, 2002, 02:20 AM
#1
Thread Starter
Registered User
Marking a row for deletion in a dataset.
I am trying to remove one or many rows from a dataset and be able to access the details of each deleted row.
For example:
Dim dr As DataRow
dr =myDataset.Tables("tbl_Alerts").rows(.Rows.Count - 1)
Debug.WriteLine(dr.Item(0) & "," & dr.RowState)
.Rows.Remove(dr)
'dr.Delete()
Debug.WriteLine(dr.Item(0) & "," & dr.RowState)
However I get an exception with the last line:
An unhandled exception of type 'System.Data.RowNotInTableException' occurred in system.data.dll
Although I could store an array of the ids of the rows I have deleted, I would prefer to be able to work with the dataset if possible. Does anyone know how to flag the datarow for deletion without actually deleting it?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|