0

I am trying to add tables from an existing Advantage Database (recently upgraded from v8 to v10) to a .NET project via the Entity Framework. However, no matter what I do, the relationships between the tables are not being imported from the database. Obviously, I can just recreate them in Visual Studio, but I'd prefer to keep the data structure primarily in the database.

This link describes the problem, but the solution (permissions issues) doesn't work for me. We're using the IGNORERIGHTS security mode in connections, and user permissions are not enabled on the database.

Based on this chapter, I've made sure that the tables in question are ADT tables, and have Primary keys which are non-nullable. I've also verified that the RI constraints exist and show up in Advantage's visual designer.

Despite all that, when I "Update Model from Database" in the EDMX and select the tables which have a reference between them, no reference is created.

Is there anything else I can try? Some step I'm missing? A setting that needs to change?

Bobson
  • 13,498
  • 5
  • 55
  • 80
  • The permissions issue might still be the problem. The active user when you run the "update model from database" *must* have alter permissions on the tables in order to be able to view the RI rules. It does not matter if you have not enabled the use of user permissions on the database. Just to test it, use adssys as the user when running the "update model ..." – Mark Wilkins Jun 08 '12 at 20:42
  • Tried it with adssys. No change. – Bobson Jun 08 '12 at 21:27
  • @MarkWilkins - I'm finally getting back to this project. Any other ideas? Is there any way I can show you the database tables to make sure I set those up right? – Bobson Jun 15 '12 at 18:12
  • I'm unsure what might cause that behavior. Maybe try running a query against ADS "select * from system.relations" and see if it shows the referential integrity definitions. I believe that is how the provider retrieves that information. Otherwise, it may be necessary to contact Advantage tech support. – Mark Wilkins Jun 15 '12 at 20:45
  • @MarkWilkins, They show up. I guess I'll have to contact Sybase directly, or just create the associations via the EF designer. Thanks for trying. – Bobson Jun 15 '12 at 21:20

1 Answers1

1

I ended up deleting the EDMX for entirely unrelated reasons, and when I recreated it, relationships worked just fine. It's quite possible that Mark's suggestion was the answer, but for new ones only. I didn't do any extensive testing to try and confirm that, though.

Bobson
  • 13,498
  • 5
  • 55
  • 80