asp.net mvc - Foreign keys not working in link table in Linq2Sql -


I have 3 tables subcontract, company, and a link table company.Tasbacterized I link sub-contract_ID and company_id in the table is. Foreign keys were installed in SQL and when I used to drug them in their DBML, one-to-many relations were shown to the arrows and everything looked fine, however, when coding, it seems that the relationships are not there.

When I write a selection statement, then I have to use it to get involved in the work. When I mention CompanyToSubcontract in the code, I do not have the right members available. I have company tosbacteract.com pany_id and CompanyToSubcontract.subcontract_id, but company is not with BCTActic company or company.

I have another table group with one-to-many relationships with subcontractes. I set up foreign key in the same way and it is doing great work, I can use subcontract.group_id as well as subcontract group.

Everything for the link table is being installed properly, but I can not find it to work, what is the type of trick for many foreign keys? What am I missing?

EDIT: Is not my primary key for membership of the company. Can this be the problem? It is trying now.

That was what he was. I need a primary key on the link table.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -