Hi,
I've a datatable in a dataset which I populate a group of records from code.
When I call the update method of the relevant sqldataadapter to that
datatable I get this error :
Concurrency violation: the UpdateCommand affected 0 records.
My code which populates the records in that datatable is like this :
MyDataRow = EditBaseDataSet.Tables["Tbl_OrderDetails"].NewRow();
MyDataRow["OrderId"] = EditBaseDataSet.Tables["Tbl_Orders"].Rows[0]["Id"];
MyDataRow["PlayDate"] = MyDate;
MyDataRow["TimeFrameId"] =
EditBaseDataSet.Tables["Tbl_TimeFrames"].Rows[j]["Id"];
MyDataRow["ClientId"] = MySqlDataReader["ClientId"];
MyDataRow["ItemCount"] = integerUpDown1.Value;
EditBaseDataSet.Tables["Tbl_OrderDetails"].Rows.Add(MyDataRow);
I disabled the concurrency check in DataAdapter but this didn't help.
Another weird thing is that all the records in that table are new where the
error states the problem occurs in UpdatCommand?
I use Visual C# 2003 with Sql Server 2000 backend.
Any help will be appreciated...
Thanks,
Özden Irmak
|