I get
Failed to enable restrictions. One or more lines contain values violating non-empty, unique or foreign keys.
for the next query in my table adapter.
select f.id, f.name, p.productid, p.masterproductID, f.productid, f.dateCreated, f.retired, p.code as HTML_DisplayName, p.ThumbnailID, p.code from FormSaveData f inner join Products p on (f.productid = p.ProductID or f.productId = p.MasterProductID) where f.userId = 130559 and (p.b_IsArchived = 0 and p.b_IsRetired=0 and p.b_IsStaged = 0)
When I run the query on its own, it works fine, other userIds also work very well, so this is a very special case. I narrowed it down to the point that I'm inside
f.productid = p.ProductID **or** f.productId = p.MasterProductID
I believe that in some rare cases this causes some kind of conflict that the table adapter does not like. I am pretty much new when it comes to table and SQL adapters, so we will be very grateful for advice on how to write this better or why this is happening.
There are no restrictions, keys, or special rules in the FormSaveData table.
source share