This is a migrated thread and some comments may be shown as answers.

many to many relationship

1 Answer 47 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hans
Top achievements
Rank 1
Hans asked on 05 Nov 2010, 05:34 PM
Hi !

I have 2 classes Contractor and Job . Each of each with id , name properties plus a property Ilist( of the other class)

The job is mapped to a view in database.
When I compile the project I get this error

Error 103 OpenAccess Error: Foreign key 'ref_Cntrctr_CntrctrLstJbLst_Cn' references object 'Contractor_JobList' which is not a user table.
Could not create constraint. See previous errors. TSL_Timesheet_Model 

Error 102 OpenAccess Error: Telerik.OpenAccess: Updating SQL schema failed. Telerik.OpenAccess.OpenAccessException: SQL exception on 'ALTER TABLE [Contractor_ContractorListJobList] ADD CONSTRAINT [ref_Cntrctr_CntrctrLstJbLst_Cn] FOREIGN KEY ([JobNo]) REFERENCES [Contractor_JobList]([JobNo])' : Foreign key 'ref_Cntrctr_CntrctrLstJbLst_Cn' references object 'Contractor_JobList' which is not a user table.
Could not create constraint. See previous errors. TSL_Timesheet_Model 


Contractor_Job List is the view in sql server database.

If I take out these ilist properties, the program is running correctly, create Contractor_List table , I marked the Contractor_JobList to not create the table.

What should I do ?
I work with ORM classic.

Best regards,
Hans











1 Answer, 1 is accepted

Sort by
0
Accepted
PetarP
Telerik team
answered on 11 Nov 2010, 03:15 PM
Hi Hans,

 The operation you are trying to complete is forward mapping. However during forward map we alter only the user defined tables. Modifications of view is not supported.
The only workaround I can provide you with is to create the relationship on your database server and then reverse map it.
I am sorry for the inconvenience this might be causing you.

Sincerely yours,
Petar
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Development (API, general questions)
Asked by
Hans
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or