I am attempting to persist my disconnected dataset deletes to my SQL database with a SQlCommand, using the following (C#) code:
The rows have rowstate of deleted.
This generates an exception: "Deleted row information cannot be accessed through the row"
Can anyone tell me why this should be so? And/or how else I might access the row information?
This code is part of a sequence of delete commands - some hierarchical, some not - that I am attempting to execute within a transaction.
I was not able to accomplish this using table adaptors.
Code:
DataRow[] products = ds.dt.Select("OfferID = " + offerID);
foreach (DataRow product in products)
{
deleteCmd.Parameters[0].Value = product["ProductCode"].ToString().ToUpper();
deleteCmd.Parameters[1].Value = Convert.ToInt32(product["OfferID"]);
deleteCmd.ExecuteNonQuery();
}
The rows have rowstate of deleted.
This generates an exception: "Deleted row information cannot be accessed through the row"
Can anyone tell me why this should be so? And/or how else I might access the row information?
This code is part of a sequence of delete commands - some hierarchical, some not - that I am attempting to execute within a transaction.
I was not able to accomplish this using table adaptors.