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
Miscellaneous
Thread ID:
01375254
Message ID:
01375263
Views:
13
Perfect!

Thanks!



>
oCommand.CommandText = "delete from students where recordid = " + Row["RecordId", DataRowVersion.Original].ToString();
HTH
>
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform