entity framework - getting null exception using foreign key
- by Nick
Having some trouble with what should be a very simple scenario. For example purposes, I have two tables:
-Users
-Comments
There is a one-to-many relationship set up for this; there is a foreign key from Comments.CommentorID to Users.UserID. When I do the LINQ query and try to bind to a DataList, I get a null exception. Here is the code:
…