Error when saving link table: Cannot insert the value NULL into column ‘ParentId’, table ‘TableParentChild’; column does not allow nulls. INSERT fails
I’m writing an import and need to save two types of data (parent & child) to their respective tables and a link table (parentChild) to join them up. I know the error is pretty self explanatory and there have been lots of other people asking similar questions – but this is different. Between here, chatGpt, searching the project for examples and my own stuff I haven’t been able to come up with something that works. I think it’s a problem with the FK constraint but it’s the same pattern I’ve used elsewhere. It clearly *thinks *I’m sending null but somehow it’s not pulling the ids from the two objects being linked.