Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleting current row in a datatable
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00981229
Message ID:
00981240
Vues:
53
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform