%VOSWARNING%
%META:TOPICPARENT{name="VirtOJDBCEntityFrameworkUsage"}%
---+++Creating an Entity Data Model (EDM) for the ODBC to JDBC Bridge Northwind database
The following steps can be used to create an Entity Data Model (EDM) for the ODBC to JDBC Bridge Northwind database:
1 Launch the Visual Studio 2008 SP1 IDE.
%BR%%BR%%BR%%BR%
1 Create a Web Application project by going to the File menu in Visual Studio and choosing New Project. %BR%%BR%
1 When the New Project window appears, choose either Visual Basic or Visual C# as your programming language.%BR%%BR%
1 Within the language category, click on Web and select ASP.NET Web Application from the right-hand panel. %BR%%BR%
1 Choose a name for the project, for example VirtuosoDataService, and click OK.
%BR%%BR%%BR%%BR%
1 This will create a new project called VirtuosoDataService.
%BR%%BR%%BR%%BR%
1 Right click on the VirtuosoDataService project name of the Solution Explorer pane. Then, select the Add -> New Item menu options.
%BR%%BR%%BR%%BR%
1 The Add New Item dialog will appear. Choose the ADO.NET Entity Data Model template. Give it the name Virtuoso.edmx and click Add to start the creation of the ADO.Net Entity Data Model.
%BR%%BR%%BR%%BR%
1 In the Entity Data Model Wizard dialog Choose Model Contents page, select the Generate from Database model type and click Next.
%BR%%BR%%BR%%BR%
1 In the Entity Data Model Wizard dialog Choose your Data Connection page, select the New Connection button.
%BR%%BR%%BR%%BR%
1 In the Choose Data Sourcedialog, select the OpenLink Virtuoso Data Source from the list and click Continue.
%BR%%BR%%BR%%BR%
1 In the Add Connection dialog, specify the hostname, portno, username, and password for the target Virtuoso Server and and check the Save Password check box.
%BR%%BR%%BR%%BR%
1 Select the Select Database From List radio button and choose the jdbc database from the drop down list.
%BR%%BR%%BR%%BR%
1 Press the Test Connection dialog to verify the database is accessible.
%BR%%BR%%BR%%BR%
1 Click OK to add the connection.%BR%
%BR%%BR%%BR%%BR%
1 Set the entity connect string name to VirtuosoEntities (note this name as it is required in the section on creating an ADO.Net Data Service) and click Next.
%BR%%BR%%BR%%BR%
1 In the Choose your Database Objects page, tick the Tables check box to select all tables in the JDBC catalog for addition to the Entity Data Model. Set the Model Namespace to VirtuosoModel and click Finish.
%BR%%BR%%BR%%BR%
1 The Virtuoso.edmx EDM will be created with the tables and relationships displayed in the Visual Studio IDE.
%BR%%BR%%BR%%BR%
Creation for the Entity Data Model for the ODBC to JDBC Bridge Northwind database is now complete.