4 Using the Data Providers in Visual Studio : Using the Data Provider with the ADO.NET Entity Framework

Using the Data Provider with the ADO.NET Entity Framework
NOTE: Developing with the ADO.NET Entity Framework requires that you are using Microsoft .NET Framework Version 3.5 SP1 or higher, and Visual Studio 2008 SP1 or higher with a DataDirect Connect ADO.NET Entity Framework data provider.
The Entity Framework creates a model of your data in Visual Studio.
The following procedure assumes that you already have the database schema available.
To create a data model:
1
2
In the Solution Explorer, right-click the project and select Add / New Item. The Add New Item dialog box appears.
Add New Item window. ADO.NET Entity Data Model is selected.
3
Select ADO.NET Entity Data Model, and then click Add. The Entity Data Model Wizard appears.
Choose Model Contents window. Generate from database is selected.
4
Select Generate from database; then, click Next. The Choose Your Data Connection window appears.
Entity Data Model wizard, on the Choose Your Data Connection screen
5
Select an established connection from the drop-down list. Alternatively, click New Connection... and do the following steps to create a new connection:
a
b
On the Choose Data Source window, select Progress DataDirect in the Data source list; then, select your data provider in the Data provider drop-down list.
c
Click OK.
d
6
a
If the radio buttons are selectable, select Yes, include the sensitive data in the connection string.
b
In the Save entity connection settings in App.Config as field, type a name for the name of the main data access class, or accept the default.
c
Click Next. The Choose Your Database Objects window appears.
7
Entity Data Model Wizard, on the Choose Your Database Objects window
The model is generated and opened in the Model Browser.
Model of the selected objects shown in the Model Browser
For more information about using the ADO.NET Entity Framework with the supported DataDirect Connect data providers, refer to the DataDirect Connect Series for ADO.NET Reference.