3 Using Your Data Provider with the ADO.NET Entity Framework : Using the Database First Model

Using the Database First Model
The Entity Framework creates a model of your data in Visual Studio.
NOTE: Developing using the Database First model requires that you are using Microsoft .NET Framework Version 3.5 SP1 or higher, and Visual Studio 2008 SP1 or higher with the DataDirect Connect for ADO.NET Version 4.0 ADO.NET Entity Framework data providers.
The following procedure uses the Oracle ADO.NET Entity Framework data provider, and assumes that you already have the database schema available.
1
2
In the Solution Explorer, right-click the project and select Add / New Item. The Add New Item window appears.
Add New Item window. ADO.NET Entity Data Model is selected.
3
Select ADO.NET Entity Data Model, and then click Add. The Choose Model Contents window appears.
The Choose Model Contents window, with Generate from database selected.
4
Select Generate from database, and then click Next. The Choose Your Data Connection window appears.
Entity Data Model wizard, on the Choose Your Data Connection screen
5
6
Click New Connection... to create a new connection.
a
On the Choose Data Source window, select Other in the Data source list, then select your data provider, for example, Progress DataDirect Connect for ADO.NET Oracle Data Provider, in the Data provider drop-down list.
b
Click Continue.
c
7
a
If the radio buttons are selectable, select Yes, include the sensitive data in the connection string.
b
In the Save entity connection settings... 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.
Entity Data Model Wizard, on the Choose Your Database Objects window
8
9
Click Finish. The model is generated and opened in the Model Browser.
Model of the selected objects shown in the Model Browser