Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting current row in a datatable
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00981229
Message ID:
00981240
Views:
57
This message has been marked as the solution to the initial question of the thread.
If C# doesn't like what I am casting it to, cast it to something else <s> This seems to work like I wanted it to:
((System.Data.DataRowView) this.myBindingManager.Current).Delete();
Einar

>I have a table (System.Data.DataTable) and I have a binding manager assosiated with the table.
>I have added a delete record button, but I am having problems deleting the "current" record.
>Using this code I can delete the first record in the table:
>
>this.myTable.Rows[0].Delete();
>
>
>I tried using the following code to delete the "current" record:
>
>((System.Data.DataRow) this.myBindingManager.Current).Delete();
>
>but C# doesn't like my cast (System.InvalidCastException: Specified cast is not valid.)
>
>Any help would be appreciated.
>
>Thanks,
>Einar
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform