0

I have a database first MVC application I create table in sql server and do Update model form database in EF edmx it work fine but when I change data type of a filed of a table and Update model from database it give the following error:

Schema specified is not valid. Errors:

MRBQModel1.msl(143,12) : error 2019: Member Mapping specified is not valid. The type 'Edm.Int32[Nullable=False,DefaultValue=]' of member 'QuestionLabelId' in type 'QuestionDbModel.T_QestionLabelText' is not compatible with 'SqlServer.varchar[Nullable=False,DefaultValue=,MaxLength=50,Unicode=False,FixedLength=False]' of member 'QuestionLabelId' in type 'QuestionDbModel.Store.T_QestionLabelText'.

Please give a sollution

2
  • can you post your entity and schema of the table?
    – PM.
    Aug 13, 2015 at 10:35
  • you need to edit your post to specify the details needed to solve this issue, instead of editing the answer.
    – PM.
    Aug 13, 2015 at 11:49

1 Answer 1

0

Error message says that datatype of QuestionLabelId is integer in your entity, whereas the database has the same field with datatype nvarchar. So you must have same datatype at both places.

How are you doing with Entity framework? I mean is it a code first or data first?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.