<docbook><section><title>VirtMySQLEDM</title><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">Creating an Entity Data Model (EDM) for the MySQL Northwind database</bridgehead>
<para>The following steps can be used to create an Entity Data Model (EDM) for the MySQL Northwind database:</para>
<orderedlist spacing="compact"><listitem>Launch the Visual Studio 2008 SP1 IDE.
<figure><graphic fileref="VirtMySQLEDM/VirtAdoNetDataServices_1.png" /></figure> </listitem>
<listitem>Create a <emphasis>Web Application</emphasis> project by going to the <emphasis>File</emphasis> menu in Visual Studio and choosing <emphasis>New Project</emphasis>.
  </listitem>
<listitem>When the New Project window appears, choose either <emphasis>Visual Basic</emphasis> or <emphasis>Visual C#</emphasis> as your programming language. </listitem>
<listitem>Within the language category, click on <emphasis>Web</emphasis> and select <emphasis>ASP.NET Web Application</emphasis> from the right-hand panel.
  </listitem>
<listitem>Choose a name for the project, for example <emphasis>VirtuosoDataService</emphasis>, and click <emphasis>OK</emphasis>.
<figure><graphic fileref="VirtMySQLEDM/VirtAdoNetDataServices_2.png" /></figure> </listitem>
<listitem>This will create a new project called <emphasis>VirtuosoDataService</emphasis>.
<figure><graphic fileref="VirtMySQLEDM/VirtAdoNetDataServices_3.png" /></figure> </listitem>
<listitem>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> </listitem>
<listitem>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> </listitem>
<listitem>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> </listitem>
<listitem>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> </listitem>
<listitem>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> </listitem>
<listitem>In the <emphasis>Add Connection</emphasis> dialog, specify the <emphasis>hostname</emphasis>, <emphasis>portno</emphasis>, <emphasis>username</emphasis>, and <emphasis>password</emphasis> for the target Virtuoso Server and and check the <emphasis>Save Password</emphasis> check box.
<figure><graphic fileref="VirtMySQLEDM/VirtAdoNetAddConn.png" /></figure> </listitem>
<listitem>Select the <emphasis>Select Database From List</emphasis> radio button and choose the <emphasis>mysql</emphasis> database from the drop down list.
<figure><graphic fileref="VirtMySQLEDM/VirtMySQLEDM4.png" /></figure> </listitem>
<listitem>Press the <emphasis>Test Connection</emphasis> dialog to verify the database is accessible.
<figure><graphic fileref="VirtMySQLEDM/VirtEDM5.png" /></figure> </listitem>
<listitem>Click <emphasis>OK</emphasis> to add the connection. <figure><graphic fileref="VirtMySQLEDM/VirtMySQLEDM5_1.png" /></figure> </listitem>
<listitem>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> </listitem>
<listitem>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> </listitem>
<listitem>The <emphasis>Virtuoso.edmx</emphasis> EDM will be created with the tables and relationships displayed in the Visual Studio IDE.
<figure><graphic fileref="VirtMySQLEDM/VirtMySQLEDM6.png" /></figure></listitem>
</orderedlist><para>Creation for the Entity Data Model for the MySQL Northwind database is now complete.
</para>
</section></docbook>