Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access Deleted Row's PK
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Access Deleted Row's PK
Divers
Thread ID:
01375254
Message ID:
01375254
Vues:
48
I'm trying this:
// Delete the test row
oDS.Tables[0].Rows[oDS.Tables[0].Rows.Count - 1 ].Delete();

foreach (DataRow Row in oDS.Tables[0].Rows)
{
    oCommand.Parameters.Clear();

    switch (Row.RowState)
    {
        case DataRowState.Added:
            break;

        // Do the same for DataRowState Deleted and Modified
        case DataRowState.Deleted:
            oCommand.CommandText = "delete from students where recordid = " + Row["RecordId"].ToString();
            break;

        case DataRowState.Modified:
            break;
    }

    oCommand.ExecuteNonQuery();
}
On the row with the delete command I get "Deleted row information cannot be accessed through the row"

So how DO you get it???
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform