I am using typed datasets with datagrids. When I delete a row I use the dataset.HasChanges
filter and get changes as follows.
dtDel = (Database1DataSet1.product_skuDataTable)database1DataSet1.product_sku.GetChanges(DataRowState.Deleted);
I am trying to get values(Product Names) from deleted rows as follows.
private string getProdNames(DataTable dtDel)
{
string prodNames = "";
var q = dtDel.AsEnumerable().Select(x => x.Field<string>("ProductName"));
foreach (string p in q)
{
prodNames += p + "\n";
}
return prodNames;
}
But I am getting the following error.
Deleted row information cannot be accessed through the row.
Thanks