Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more: , +
hello
i create three tables like this in sql 2008:

table1:pId(primary key),title
table2:bId(primary key),Name,pId(foreignkey)
table3:pId,bId:(primary key,foreignkey)
table3 pId:foreign key to table1
bId:foreignkey to table2

i use entity framework,when i update model and add table3 to entity model,it dosent add it to model and it add a new relation from table1 to table2.why?please help me.what can i do?


Thank you in advance
Posted
Updated 26-Jul-15 6:58am
v2
Comments
Suvendu Shekhar Giri 26-Jul-15 9:27am    
Without seeing code it's difficult to tell where the problem is.
Sreekanth Mothukuru 27-Jul-15 6:40am    
First delete the third table from the edmx file. Now add a new unique/identity column to the table 3 in database to make it appear in the model/edmx. Set proper relations on table 1,2 and 3. Now update the edmx file from the changes made in DB.
user12213212 4-Aug-15 4:01am    
thats right.but i want to set pId,bId primary and foreign key.can insert a ID column that it isnt primary key?i have search with pId,bId.what do i do?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900