Thursday, May 26, 2011

The ViewData item that has the key 'XXX' is of type 'System.Int32' but must be of type 'IEnumerable'.

If you're using ASP.Net MVC and you get this message using a DropDownList...

... then check whether the IEnumerable you think you are passing in actually exists in your ViewBag/ViewData

Saturday, May 21, 2011

A value shared across entities or associations is generated in more than one location.

If you're using EntityFramework and you see this error - 

A value shared across entities or associations is generated in more than one location.


Then what it means is: you've set up inheritance using multiple tables and you've left the key autogenerated in one of the derived types.