ConstraintException thrown when calling DataTable.RejectChange

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top