Oracle table with No primary Key

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
ChrisWalker
Posts: 10
Joined: Mon 01 Mar 2010 20:17
Contact:

Oracle table with No primary Key

Post by ChrisWalker » Mon 05 Apr 2010 15:14

I have an oracle table with no defined primary key. When I pull the table into the .connect modeler, the modeler makes the all columns in the table the primary key and makes then not nullable; including columns that should be nullable.

When I try to retrieve data, I get a runtime error stating that the column cannot be null.

I have tried going into the modeler and modifying the properties for the rows that aren't populated in the table and set the EntityKey property to false and the Nullable property to true but I get an error in the model.

1 All the key properties (Facility2s.FacilityCode,
Facility2s.MinPwLength,
Facility2s.NumPreviousPw,
Facility2s.PwNumReqYn,
...
Facility2s.RosterDefCursorLastnameYn) of the EntitySet Facility2s must be mapped to all the key properties (FACILITY2s.FACILITY_CODE, FACILITY2s.HIGHLIGHT_REQD_FIELDS_ON_MEDS, FACILITY2s.MAX_LOGIN_FAILURES,
...
FACILITY2s.WARN_PATIENT_NOT_ADMITTED) of table FACILITY2s.
Facility2


In reality the FaciltyCode should be the primary key on the table but I cannot make them set the FacilityCode as the primary key. Any help?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 06 Apr 2010 14:25

You should adjust Entity Key both in Conceptual and Store parts of the model.
I have described the process in the answer to your other post.

ChrisWalker
Posts: 10
Joined: Mon 01 Mar 2010 20:17
Contact:

Post by ChrisWalker » Tue 06 Apr 2010 17:53

Thanks. modifying the .edmx file manually worked.

Post Reply