Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to find the key field for a deleted row
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00709493
Message ID:
00709503
Views:
21
You can create a DataView on your DataTable to only include the Deleted records. You use the RowStateFilter like below:
Dim dv As New DataView(ds.Tables("MyDataTable"),"","",DataViewRowState.Deleted)
>I'm using a DataGrid to edit a table in a DataSet in a Web form. When the user clicks on the Delete button for a row, the row is marked Deleted in the DataSet. After various rows are edited, I need to iterate through the edited rows and do some database operations that depend on the values of the primary key fields for these rows. How can I get the key after the row is deleted? (You cannot access the columns of a deleted row directly.)
>
>I suppose I could keep an array of keys of deleted records and add the row key to the array when the row is deleted, but that seems like a lot of work.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform