<docbook><section><title>VirtInformixEntityFrameworkUsage</title><para> </para>
<title>  Using Microsoft Entity Frameworks to Access Informix Schema Objects with Virtuoso</title>  Using Microsoft Entity Frameworks to Access Informix Schema Objects with Virtuoso
<para>This document details the steps required to provide Microsoft Entity Framework access to Informix Schema Objects using the OpenLink Virtuoso Universal Server.
 This is achieved by linking the required Informix Schema objects into Virtuoso using its built-in Virtual Database engine and then using the Virtuoso ADO.NET Entity Framework provider to query the remote Informix Schema objects linked into the Virtuoso Server.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Prerequisites</bridgehead>
<para>The following must be in place to complete this exercise.</para>
<orderedlist spacing="compact"><listitem><emphasis>Microsoft Visual Studio 2008 SP1 (or later)</emphasis> Microsoft Visual Studio 2008 Service Pack 1 (or later) is required, as previous versions do not include the necessary Entity Framework support. </listitem>
<listitem><emphasis>Virtuoso ADO.NET Entity Framework Provider, v5.10 or later</emphasis> The ADO.NET Entity Framework Provider must be installed on the Visual Studio development and deployment host(s).
 Version 5.10.x or later is required, as previous versions do not include the necessary Entity Frameworks support. </listitem>
<listitem><emphasis>Virtuoso Universal Server, v5.10 or later</emphasis> Virtuoso Universal Server Release 5.10 or later is required, as previous versions do not include the necessary Entity Frameworks support.
 This may be on any host which is TCP/IP accessible from the Visual Studio development and deployment host(s). </listitem>
<listitem><emphasis>ODBC Driver for Informix</emphasis> The Virtuoso Server uses an ODBC Driver for Informix to link in the Informix Schema Objects.
 The <emphasis>OpenLink Single-Tier ODBC Driver for Informix</emphasis> will be used in this document, and a functional ODBC Data Source Name (DSN) of &quot;inf10ma&quot; will be assumed to exist on the machine hosting the Virtuoso Server.
 Any ODBC compliant driver for Informix should work. </listitem>
<listitem><emphasis>Informix DBMS</emphasis> An Informix DBMS hosting the required Schema Objects needs to be available.
 This may be on any host which is TCP/IP accessible from the Virtuoso Server host.
 In this document, the Informix <emphasis>stores_demo</emphasis> database will be used to demonstrate the process.</listitem>
</orderedlist><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Tasks</bridgehead>
<orderedlist spacing="compact"><listitem><emphasis>Ensure Informix Primary Keys (PKs) are not nullable</emphasis> The Visual Studio 2008 Entity Data Model (EDM) requires that all primary keys are <emphasis>NOT</emphasis> Nullable, and will fail to generate an EDM if any are.
 Therefore, ensure any tables to be used are defined as not nullable in the Informix database schema before attempting to generate an EDM.
 In the case of the Informix stores_demo database, many tables have primary keys that <emphasis>are</emphasis> nullable, so these will need to be redeclared.This is possible using <emphasis>dbaccess</emphasis>.
 However, care needs to be taken, particularly with the following cases, where the additional primary and foreign key constraints that are removed will have to be manually recreated — <itemizedlist mark="bullet" spacing="compact"><listitem>Amending a PK field to be not nullable can result in the primary key constraint being removed.
</listitem>
<listitem>When a primary key is referenced by a foreign key constraint, amending the PK field to be not nullable results in the foreign key constraint being removed. </listitem>
</itemizedlist></listitem>
<listitem><emphasis><ulink url="http://wikis.openlinksw.com/dataspace/owiki/wiki/UdaWikiWeb/InstallConfigODBC">Install and configure the OpenLink ODBC Driver for Informix</ulink></emphasis> </listitem>
<listitem><emphasis><ulink url="VirtADOClientServInstall">Install and configure OpenLink Virtuoso Universal Server</ulink> </emphasis></listitem>
<listitem><emphasis><ulink url="VirtINFLinkingObjects">Link Informix tables and other schema objects into OpenLink Virtuoso</ulink> </emphasis></listitem>
<listitem><emphasis><ulink url="VirtINFEDM">Create a Visual Studio-hosted Entity Data Model (EDM)</ulink> </emphasis></listitem>
<listitem><emphasis><ulink url="VirtEntityFrameworkINFDatService">Use the EDM to create an Entity Frameworks-based ADO.NET Data Service</ulink> </emphasis></listitem>
<listitem><emphasis><ulink url="VirtInformixVisualStudioDataGridFormsApp">Use the EDM to create an Entity Frameworks-based Windows DataGrid Form Application</ulink></emphasis></listitem>
</orderedlist><para><ulink url="CategoryDocumentation">CategoryDocumentation</ulink> <ulink url="CategoryVirtuoso">CategoryVirtuoso</ulink> <ulink url="CategoryEntityFrameworks">CategoryEntityFrameworks</ulink> <ulink url="CategoryDotNET">CategoryDotNET</ulink> <ulink url="CategoryInformix">CategoryInformix</ulink></para>
</section></docbook>