hi
I want delete Item from grid view but this error happen:
Sequence contains more than one matching element
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Sequence contains more than one matching element
Source Error:
Line 205: GridViewRow row = (sender as LinkButton).NamingContainer as GridViewRow;
Line 206: int id = Convert.ToInt32(gvOrders.DataKeys[row.RowIndex].Value);
Line 207: DataRow orderRow = dtOrder.Select().Single(x => Convert.ToInt32(x["Id"]) == (id));
Line 208: dtOrder.Rows.Remove(orderRow);
Line 209: dtOrder.AcceptChanges();
|
why ?
Best regards
neda