views:

24

answers:

1

I'm new to "Linq to Entities" and i'm getting this error while passing data to the View (ASP.net MVC). I would like to know why is this happening and how can i fix that?

A: 

Most likely, you have a bad query. But since you do not show your code, I can't say for sure. Since LINQ is lazy, the query won't be executed (and, hence, you won't see the error) until you iterate it, which seems to be, in your case, when you pass the data to the view. Again, since you don't show any code, I am guessing here.

Craig Stuntz