Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access Deleted Row's PK
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Access Deleted Row's PK
Miscellaneous
Thread ID:
01375254
Message ID:
01375254
Views:
44
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
Next
Reply
Map
View

Click here to load this message in the networking platform