Hey guys, just have a quick question and I cant think of how to go around this. In our database we have a player structure then a squad structure, within the player structure there is a tab for squad which can be nullable. What im having a problem with is trying to remember how to correctly set the players squad to null.
db.player.squad = null; db.SubmitChanges();
It gives the error: LINQ to SQL ForeignKeyReferenceAlreadyHasValueException error. Ive searched for solutions but none of them are trying to make it null, all the solutions are switching entities. Anyone have an idea on how to correctly do this? Btw the squad structure, many players can be on the same squad as long as their player squad tab has that id number.
I know absolutely nothing about LINQ, however I do know a fair bit about SQL Server. The column has to be defined as able to be NULL, as in… column INT NULL FOREIGN KEY REFERENCES othertable(column) If it is maybe this LINQ thing is getting in your way.