Wednesday, 28 August 2013

Error 112 and Error 113 after adding foreign keys to database

Error 112 and Error 113 after adding foreign keys to database

This is my table ( part of the whole thing ) :

After adding foreign key and update my model from database in my visual
studio , it came up this 2 error :
Error 2 Error 112: The types of all properties in the Dependent Role of a
referential constraint must be the same as the corresponding property
types in the Principal Role. The type of property 'ActivityID' on entity
'istellarModel1.singalong' does not match the type of property
'ActivityID' on entity 'istellarModel1.activity' in the referential
constraint 'FK_singalong_activity'.
and
Error 1 Error 113: Multiplicity is not valid in Role 'activity' in
relationship 'FK_singalong_activity'. Because all the properties in the
Dependent Role are nullable, multiplicity of the Principal Role must be
'0..1'.
I checked my ActivityID in singalong have the same type as activity
table's Activity ID , and i don't understand what error 113 actually means
, i am new to database , at first i have many tables that don't link so i
link them up after sometime and update my model in visual studio ( using
entity framework ) and it gave me errors .
Any guidance on this please?

No comments:

Post a Comment