Using Microsoft Entity Frameworks to Access Progress Schema Objects with Virtuoso
This document details the steps required to provide Microsoft Entity Framework access to Progress Schema Objects using the
- Prerequisites
- Progress/OE 9 or later DBMS
- ODBC Driver for Progress (SQL-92)
- Virtuoso 5.10.x or later
- Microsoft Visual Studio 2008 SP1 or later
- Tasks
- 1 - Ensure Progress Primary Keys (PKs) are not NULLable
- 2 - Install and configure ODBC Driver for Progress (SQL-92)
- 3 - Install and configure Virtuoso
- 4 - Link Progress tables into Virtuoso
- 5 - Create a Visual Studio Entity Data Model (EDM)
- Use the EDM to create Entity Framework applications
Prerequisites
Progress/OE 9 or later DBMS
A Progress isports
sample database will be used to demonstrate the process.
ODBC Driver for Progress (SQL-92)
A Progress ODBC Driver is required to link the Progress Schema Objects into the Virtuoso Server.
The OpenLink ODBC Driver for Progress (SQL-92) will be used in this document, for which a functional ODBC Data source name of prs101c
will be assumed to exist on the machine hosting the Virtuoso Server.
Virtuoso 5.10.x or later
An
Microsoft Visual Studio 2008 SP1 or later
Microsoft Visual Studio 2008 with Service Pack 1 or later is required, this being the earliest version containing the necessary Entity Framework support.
Tasks
1 - Ensure Progress Primary Keys (PKs) are not NULLable
The Visual Studio 2008 Entity Data Model (EDM) requires that all primary keys are NOT NULLABLE
.
Visual Studio 2008 will fail to generate an EDM, if any primary keys are nullable.
Therefore, ensure that any applicable primary keys are defined as not nullable in the Progress database schema before attempting to generate an EDM.
By default, several Primary Keys (PKs) in the isports
database allows NULL
values.
It seems somewhat nonsensical that a unique key whose sole purpose is to identify rows in tables can be allowed to be NULL
.
This issue is best addressed directly in the database schema, by redefining those PKs that allow NULL
so as not to allow NULL
.
Progress documentation does not talk in terms of NULL
; instead, it uses the term Mandatory.
Our documentation provides more specific details about how to ensure Progress PKs are not nullable.
2 - Install and configure ODBC Driver for Progress (SQL-92)
The Virtuoso Virtual Database engine uses ODBC as the connectivity mechanism for linking remote database objects into its local schema.
Thus, a Progress ODBC Driver must be available with a suitably configured DSN for connecting to the target database.
The
Installation instructions for the
3 - Install and configure Virtuoso
4 - Link Progress tables into Virtuoso
5 - Create a Visual Studio Entity Data Model (EDM)
In the event that no entity-linking associations are automatically created (as is the case here with Progress), the EDM Associations (FKs) will need to be created manually.
Use the EDM to create Entity Framework applications
Now that a Microsoft Entity Data Model has been created for the Progress isports
database, Entity Framework applications can be created to make use of it.
Entity Framework Data Service
Visual Studio Windows Form Application
Referenced by...