Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete row in dataview
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01048268
Message ID:
01048286
Vues:
20
David,
Try the following code (skip the .Row):
foreach (DataRowView drv in goView)
{
  if (drv["userid"].ToString().Equals("DSMI"))
  {
    drv.Delete();
  }
  else
  {
    drv["userid"] = drv["userid"].ToString() + "Kretek";
  }
}
Also keep in mind thatthe data row is not permanently deleted (from the table) until acceptchanges is issued.

Hope this helps.
Einar



>Tried doing the code below to delete a record from a dataview but its telling me there is no row at that location? I'm not sure if I'm doing this right?
>
>
>foreach (DataRowView drv in goView)
>{
>if (drv["userid"].ToString().Equals("DSMI"))
>{
>drv.Row.Delete();
>}
>else
>{
>drv["userid"] = drv["userid"].ToString() + "Kretek";
>}
>}
>
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform