ConstraintException thrown when calling DataTable.RejectChange

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All

I have a data table populated fron data adaptor. What I did was to delete
one row using DataRow.Delete(), then add the same rowagian. Now when I call
dataTable.RejectChange() got ConstraintException.

Any idea about how to get around this problem?

Regards

Jie
 
The delete method keeps the same row there like a pointer. You need to check
if the reow has its flag set to deleted(don't remember the flag off top my
head). There is another method you can use instead of delete. The remove
method takes the row out of the dataset. It is handy if you are not posting
the table changes back to the database.

Ben
 
Back
Top