I am getting the error below while using the command datatable.update using strongly typed dataset. I am adding all the rows to product data table in session and then inserting the rows when submit button is clicked. The error appears only if i try to update the rows in product data table and then submit all the records using code below.
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records
The code is as below.
public void btnsubmit_click()
{
for (int i=0; i<ProductDataTbl.Rows.Count ; i++) {
DataRow dr = ProductDataTbl.Rows; dr["EmployeeID"]= Convert.ToInt32(ViewState["EmployeeID"].ToString());
}
prodAdapter.Update(ProductDataTbl);