This document details the steps required to provide Microsoft Entity Framework access to Sybase Schema Objects using the
The following prerequisites must be in place for this solution to be possible.
A Sybase DBMS hosting the required Schema Objects needs to be available. In this document the Sybase pubs2 sample database will be used to demonstrate the process.
A Sybase ODBC Driver is required for Linking the Sybase Schema Objects into the Virtuoso Server.
syb15ma will be assumed to exist on the machine hosting the Virtuoso Server.
An Virtuoso installation including the Virtuoso Universal Server and ADO.NET Entity Framework Provider is required. The Virtuoso components used must be Release 5.10.x or above, this being the minimum version containing support for Microsoft Entity Frameworks.
Microsoft Visual Studio 2008 Service Pack 1 is required, this being the only version containing the necessary Entity Framework support available at the time of writing.
The Visual Studio 2008 Entity Data Model (EDM) requires that all primary keys are NOT Nullable. It will fail to generate an EDM, if any are. Therefor, ensure any primary keys to be used are defined as not nullable in the Sybase database schema before attempting to generate an EDM. In the case of the Sybase pubs2 database, all tables are non nullable. Thus, this should not be an issue in this case.
The Virtuoso Virtual Database engine uses ODBC as the connectivity mechanism for linking remote database objects into its local schema.
Thus, a Sybase ODBC Driver must be available with a suitably configured DSN for connecting to the target database.
Installation instructions for the
In the event that no entity-linking associations are automatically created (as is the case here with Sybase), the associations will need to be created manually. The following document details this process —
Now that a Microsoft Entity Data Model has been created for the Sybase pubs2 database, Entity Framework applications can be created to make use of it.