SqlDataAdapter.Update Exception - how to get row/table of error
Posted on 2008-06-13
I'm getting an exception on SqlDataAdapter.Update().
The error message is "Table: eeeHomeOffice.dbo.SalePayments Exception: The record can't be added or changed. Referential integrity rules require a related record in table 'SaleHeader'.".
I dumped the DataSet to XML and can't see any relationship problems.
How do I tell what row and table is having the problem?
What order are the records written out? The SaleHeader is the first table in the set and SalePayments is second. Is it possible that it's trying to write SalePayments records first?
Some of the data sets are working fine, only a small percentage throw the exception.