many to many relationship

2 posts, 1 answers
  1. Hans
    Hans avatar
    49 posts
    Member since:
    Jul 2010

    Posted 05 Nov 2010 Link to this post

    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











  2. Answer
    PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 11 Nov 2010 Link to this post

    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
  3. DevCraft banner
Back to Top