0
votes

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

1
can you post your entity and schema of the table? - PM.
you need to edit your post to specify the details needed to solve this issue, instead of editing the answer. - PM.

1 Answers

0
votes

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?