Zack Peterson
Zack Peterson

Reputation: 57323

Entity Framework Mapping SQL Server tinyint to Int16

My Entity Data Model is giving me this error:

Error 2019: Member Mapping specified is not valid. The type 'Edm.Int16[Nullable=True,DefaultValue=]' of ... is not compatible with 'SqlServer.tinyint[Nullable=True,DefaultValue=]' of ...

I've tried deleting and recreating the property. I don't know what I've done wrong.

Upvotes: 40

Views: 30255

Answers (1)

Joel C
Joel C

Reputation: 5567

A tinyint should get mapped to a .NET byte; Int16 should be the corresponding type for a smallint in SQL.

Upvotes: 82

Related Questions