Using VS 2008, SQL Server 2008 and WPF 3.5, I've made some changes to my schema and updated the model. It compiles and runs fine, until the client app calls for a specific entity and I get the following (actual names replaced):
The data reader is incompatible with the specified '<Model>.<ViewBasedEntity>'. A member of the type, '<Property>', does not have a corresponding column in the data reader with the same name.
I've searched through the services app for related entity and property names, tried renaming properties in the Table Map, Seems to be a number of others out there reporting the same error, but can't seem to find a timely answer....
...Does anyone know how to track this down, and if so, is there a fix or methodology to follow to avoid in the future?
Rather than updating the view, you can also update the Function Import:
I had a similar issue which produced the same error message - the problem was that a column name returned by the proc included a space.
When creating the complex type, [my column]
was created as my_column
.
Then when executing the proc with ExecuteStoreQuery
, my_column
did not exist in the data reader, as the proc still returned [my column]
.
Solution: remove the space from proc column name and recreate your complex type for the imported function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With