R
Ryan Liu
Hi,
In the .NET Framework SDK documentation, I can see DataRow.AcceptChanges
method will throw RowNotInTableException exeception.
And in DataTable.AcceptChanges(), the documentation does not mention it will
throw any exception, but in my code (multi-thread), I see it throw
exceptions at two situations:
dr = this.currentQuotaUserDt.NewRow();
this.currentQuotaUserDt.Rows.Add(dr);
this.currentQuotaUserDt.AcceptChanges();
Last line throw exception : Cannot perform this operation on a row not in
the table.
(Code is more complex than what list here and it is multi-thread
enviorment.)
==============
this.currentDr.Delete();
this.currentDr.Table.AcceptChanges();
The last line will throw:
System.Data.RowNotInTableException: Cannot perform this operation on a row
not in the table.
at System.Data.DataTable.SetOldRecord(DataRow row, Int32 proposedRecord)
at System.Data.DataTable.CommitRow(DataRow row)
at System.Data.DataTable.AcceptChanges()
Thanks,
Ryan
In the .NET Framework SDK documentation, I can see DataRow.AcceptChanges
method will throw RowNotInTableException exeception.
And in DataTable.AcceptChanges(), the documentation does not mention it will
throw any exception, but in my code (multi-thread), I see it throw
exceptions at two situations:
dr = this.currentQuotaUserDt.NewRow();
this.currentQuotaUserDt.Rows.Add(dr);
this.currentQuotaUserDt.AcceptChanges();
Last line throw exception : Cannot perform this operation on a row not in
the table.
(Code is more complex than what list here and it is multi-thread
enviorment.)
==============
this.currentDr.Delete();
this.currentDr.Table.AcceptChanges();
The last line will throw:
System.Data.RowNotInTableException: Cannot perform this operation on a row
not in the table.
at System.Data.DataTable.SetOldRecord(DataRow row, Int32 proposedRecord)
at System.Data.DataTable.CommitRow(DataRow row)
at System.Data.DataTable.AcceptChanges()
Thanks,
Ryan