<docbook><section><title>VirtMySQLEDM</title><bridgehead class="http://www.w3.org/1999/xhtml:h3">Creating an Entity Data Model (EDM) for the MySQL Northwind database</bridgehead>
 <bridgehead class="http://www.w3.org/1999/xhtml:h3" />
<para> The following steps can be used to create an Entity Data Model (EDM) for the MySQL Northwind database:</para><para>1.
 Launch the Visual Studio 2008 SP1 IDE.<figure><graphic fileref="VirtMySQLEDM/VirtAdoNetDataServices_1.png" /></figure></para>
<para>2.
 Create a <emphasis>Web Application</emphasis> project by going to the <emphasis>File</emphasis> menu in Visual Studio and choosing <emphasis>New Project</emphasis>.
 </para><para>3.
 When the New Project window appears, choose either <emphasis>Visual Basic</emphasis> or <emphasis>Visual C#</emphasis> as your programming language.</para><para>4.
 Within the language category, click on <emphasis>Web</emphasis> and select <emphasis>ASP.NET Web Application</emphasis> from the right-hand panel.
 </para><para>5.
 Choose a name for the project, for example <emphasis>VirtuosoDataService</emphasis>, and click <emphasis>OK</emphasis>.
<figure><graphic fileref="VirtMySQLEDM/VirtAdoNetDataServices_2.png" /></figure></para><para>6.
 This will create a new project called <emphasis>VirtuosoDataService</emphasis>.
<figure><graphic fileref="VirtMySQLEDM/VirtAdoNetDataServices_3.png" /></figure></para><para>7.
 Right click on the <emphasis>VirtuosoDataService</emphasis> project name in the <emphasis>Solution Explorer</emphasis> pane.
 Then, select the <emphasis>Add</emphasis> -&gt; <emphasis>New Item</emphasis> menu options.
<figure><graphic fileref="VirtMySQLEDM/VirtAdoNetDataServices_4.png" /></figure></para><para>8.
 The <emphasis>Add New Item</emphasis> dialog will appear.
 Choose the <emphasis>ADO.NET Entity Data Model</emphasis> template.
 Give it the name <emphasis>Virtuoso.edmx</emphasis> and click <emphasis>Add</emphasis> to start the creation of the ADO.Net Entity Data Model.
<figure><graphic fileref="VirtMySQLEDM/VirtAdoNetDataServices_5.png" /></figure></para><para>9.
 In the <emphasis>Entity Data Model Wizard</emphasis> dialog <emphasis>Choose Model Contents</emphasis> page, select the <emphasis>Generate from Database</emphasis> model type and click <emphasis>Next</emphasis>.
<figure><graphic fileref="VirtMySQLEDM/VirtAdoNetDataServices_6.png" /></figure></para><para>10.
 In the <emphasis>Entity Data Model Wizard</emphasis> dialog <emphasis>Choose your Data Connection</emphasis> page, select the <emphasis>New Connection</emphasis> button.
<figure><graphic fileref="VirtMySQLEDM/VirtEDM1.png" /></figure></para><para>11.
 In the <emphasis>Choose Data Source</emphasis> dialog, select the <emphasis>OpenLink Virtuoso Data Source</emphasis> from the list and click <emphasis>Continue</emphasis>.
<figure><graphic fileref="VirtMySQLEDM/VirtEDM2.png" /></figure></para><para>12.
 In the <emphasis>Connection Properties</emphasis> dialog, specify the <emphasis>hostname</emphasis>, <emphasis>portno</emphasis>, <emphasis>username</emphasis> and password for the target Virtuoso Server and click the <emphasis>Advanced</emphasis> button.
<figure><graphic fileref="VirtMySQLEDM/VirtMySQLEDM3.png" /></figure></para><para>13.
 In the <emphasis>Advanced Properties</emphasis> dialog, set the <emphasis>Database</emphasis> parameter to <emphasis>mysql</emphasis> and click <emphasis>OK</emphasis>.
<figure><graphic fileref="VirtMySQLEDM/VirtMySQLEDM1.png" /></figure></para><para>14.
 Press the <emphasis>Test Connection</emphasis> dialog to verify the database is accessible.
<figure><graphic fileref="VirtMySQLEDM/VirtEDM5.png" /></figure></para><para>15.
 Set the <emphasis>entity connect string</emphasis> name to <emphasis>VirtuosoEntities</emphasis> (note this name as it is required in the section on creating and ADO.Net Data Service) and click <emphasis>Next</emphasis>.
<figure><graphic fileref="VirtMySQLEDM/VirtMySQLEDM2.png" /></figure></para><para>16.
 In the <emphasis>Choose your Database Objects</emphasis> page, tick the <emphasis>Tables</emphasis> check box to select all tables in the mysql catalog for addition to the Enity Data Model.
 Set the <emphasis>Model Namespace</emphasis> to <emphasis>VirtuosoModel</emphasis> and click <emphasis>Finish</emphasis>.
<figure><graphic fileref="VirtMySQLEDM/VirtMySQLEDM3.png" /></figure></para><para>17.
 The <emphasis>Virtuoso.edmx</emphasis> EDM will be created with the tables and relationships displayed in the Visual Studio IDE.
<figure><graphic fileref="VirtMySQLEDM/VirtMySQLEDM4.png" /></figure></para><para>Creation for the Entity Data Model for the MySQL Northwind database is now complete.
</para></section></docbook>