I have a table that has a primary key that’s an INT… I have another table, that has a foreignkey relationship to that first table, but it’s a NULLABLE INT.
This is perfectly ok, and 100% acceptable to SQL… however LINQ to SQL is complaining about mismatched types (‘int to Nullable[int]’).
Error Message: Cannot create an association ‘Store_People’. Properties do not have matching types: ‘PersonID’, ‘ID’.
How do I solve this so that the designer stops yelling at a 100% correct usage of SQL?
Here’s what I threw together. Table2’s Table1Id column is a nullable foreign key to Table1. I even threw in a few data records and tested some Linq queries…
EDIT: Since I’m getting some downvotes (apparently) for the broken link because this question is 6 years old and the host I used hasn’t survived… here’s an updated version.