SgDotNet
Singapore Professional .NET User Group -For Cool Developers

Concurrency error while using datatable.update

rated by 0 users
This post has 0 Replies | 0 Followers

Top 100 Contributor
Posts 24
priyaraj Posted: 02-19-2008 11:23 AM

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.RowsIdea;
dr["EmployeeID"]= Convert.ToInt32(ViewState["EmployeeID"].ToString());

}

prodAdapter.Update(ProductDataTbl);

}

Page 1 of 1 (1 items) | RSS
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems