D
DC
Hi,
I am implementing an app that will do massive updating on a DataTable
with multiple threads. Typically I first look up the row:
DataRow row = mydatatable.Rows.Find(key);
and then do some updating:
row.BeginEdit(); // here is where I get the exception
foreach (string colname in collist)
row[colname]=mydatacollection[colname];
row.EndEdit();
The problem is: in a multithreaded scenario the "BeginEdit" method
will raise an exception if the row is already being updated by another
thread. At least that's how the it looks to me. So I put a lock on the
row
lock (row)
{
row.BeginEdit();
....
but that didn't help. I could not find special sync objects on the row
level, so does someone know an efficient way to get this exception
over with?
Thanks in advance for any suggestion,
DC
I am implementing an app that will do massive updating on a DataTable
with multiple threads. Typically I first look up the row:
DataRow row = mydatatable.Rows.Find(key);
and then do some updating:
row.BeginEdit(); // here is where I get the exception
foreach (string colname in collist)
row[colname]=mydatacollection[colname];
row.EndEdit();
The problem is: in a multithreaded scenario the "BeginEdit" method
will raise an exception if the row is already being updated by another
thread. At least that's how the it looks to me. So I put a lock on the
row
lock (row)
{
row.BeginEdit();
....
but that didn't help. I could not find special sync objects on the row
level, so does someone know an efficient way to get this exception
over with?
Thanks in advance for any suggestion,
DC