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

Cannot setup up constraint (MS SQL)

2 Answers 44 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rob Hedgpeth
Top achievements
Rank 2
Rob Hedgpeth asked on 17 Jun 2011, 04:07 PM
I have deleted all constraints from my database tables in order to alleviate some issues with an SSIS solution I am using. Because of this when I updated my .rlinq file from the database all of my constraints were removed (as expected). 

I now want to add them back only to the object mapper. However, I am running into a problem where the field that I need to use as a foreign key is not included in the correct drop down list of fields. There seems to be something happening behind the scenes that is trying to auto-assign the relationships. Why is this, and how can I get around it?

Constraint Editor Screen Shot

From this screen shot you can see that the "Constraint Editor" is trying to assume certain connections. This would be fine if because "PatientID" exists in the second drop down list under the "Source Table" that it is excluded from the first drop down list, making it impossible to associate "PatientID" with the "ID" field (which cannot be changed in the form) under the "Target Table".

So to wrap all of that up...

All I need to do is associate "PatientID" (Source Table) with "ID" (Target Table). Am I missing something obvious here?

Thanks,

Rob

2 Answers, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 21 Jun 2011, 05:36 PM
Hi Rob Hedgpeth,

 If you would like to create associations between your classes in the object model, you should create them using the associations tool from the toolbox. It is started automatically when you drag an association from class A to class B. Creating the constraints in your object model has no value if you do not want to have constraints in your database.

I did give you the same answer in your support ticket but I am putting it here as well for anyone in the community that has the same concerns.

Greetings,
Zoran
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
0
Rob Hedgpeth
Top achievements
Rank 2
answered on 22 Jun 2011, 03:43 PM
Thanks, Zoran. Much appreciated!
Tags
Databases and Data Types
Asked by
Rob Hedgpeth
Top achievements
Rank 2
Answers by
Zoran
Telerik team
Rob Hedgpeth
Top achievements
Rank 2
Share this question
or