I came across the following error when trying to map a stored procedure to a complex type in EF 4+.
The property could not be set to a ‘Int16′ value. You must set this property to a non-null value of type ‘Int32′.
The problem was the Entity Framework was thinking the return data type was Int16 but in fact the complex type value was specified as Int32.
The solution was to make sure that your results from the stored procedure are explicitly set and cast to the right data types. You can do this by using the convert function in T-SQL. Example below.
select convert(int,myValue) from foo
Once you do implement this function into your stored procedures, you can update your mappings in EF and the problem will be fixed (well for me anyway).