views:

534

answers:

1

hi , i got Two Table named Personel and Departmant..

Personel Table ; PERSONELID int , PK not null NAME varchar SURNAME varchar DepartmanID integer

Departman Table ; DepartmanID int , PK not null DEPARTMANNAME varchar

(ONE TO MANY Relation)

i wanna association between this tables. but i cant do it. with EDMX Model Designer .. gettin errors ;

Association END KEY property PERSONELID is not mapped. Association END KEY property NAME is not mapped. blabla ....

too new at this framework , Is there any easy way of do this job in the Entity Framework , ?

i am using Firebird 2.1 DB . and Firebird.Client.Data 2.5.0.0. for provider.

+1  A: 

For a one-to-one relationship to work each table must have the same primary (unique) key.

In your case you probably have a one to many relationship:

One department can have many persons.

Shiraz Bhaiji
ok one to one , one to many , its not important cuz i cant do association thing in Entity Framework .. is there any tutorial about this ?
Ibrahim AKGUN
These relations _are_ important because they're captured by the entity framework from the schema.
Greg D
Are these relationships spesified in your database? Are the primary keys and foreign keys spesified? If all of these are in place EF should generate the model for you.
Shiraz Bhaiji
yes but its not generate them for me. using Firebird db.
Ibrahim AKGUN
Have you installed the Firebird extensions for Visual Studio?
Shiraz Bhaiji