The data reader is incompatible with the specified... A member of the type, 'Finalised', does not have a corresponding column in the data reader

entity, entity-framework, model, sql-server-2008, visual-studio-2010

Solution

If you are using a SP then update the newly added column in that Or If you are using inline query put the exact name of the newly added column . The template you are talking about does not contain the newly added column name ..Try to edit the template ..the issue will be resolved.

Problem

I have added a column in my Sql Server Db then in VS i updated model from database, there a template auto generated some code. The code compiled fine, but when i try access a the data base, the following error occurs: The data reader is incompatible with the specified 'CompassModel.tbSalesContract'. A member of the type, 'Finalised', does not have a corresponding column in the data reader with the same name. Finalised is the new column i added to my database. Does anyone know how to track this down, and if so, is there a fix or methodology to follow to avoid in the future?

Original source