Tuesday, December 4, 2012

Creating your First ADO.Net Entity Data Model

First let us create a new ASP.Net Web application project. Note that ADO.Net Entity Data Model Template is not a project type template, it is a file type template, means that you first need to create a project, then add ADO.Net Entity Data Model Template as one of the Items to the project.

Make sure that your Project is mapped to targets Framework 3.5 or Higher, you can check this is the Project Properties, in the Project properties window check that the Target Framework property is set to .net Framework 3.5 or Higher.



1. Right click on the Project and select Add -> New Item
2. Select the ADO.Net Entity Data Model Template
3. Give a name for the Model class, I will give it as EmployeeModel.edmx





4. Click Add. This will add a new DataModel file .edmx to the Project.
5. In the next Dialog which appears, select the option “Generate from Database”, click Next. This will automatically create the mappings between the Database Schema and the DataModel.
6. In the Next dialog, select the Database which you are planning to use, I will select the Employees database.




8. Select the Database objects which you want to map in your Model.
7. Test your connection click Next, give a name to the Model and click next.  
8. Select the Database objects which you want to map in your Model.




Search Flipkart Products:
Flipkart.com

1 comment:

Cheap gw2 gold said...

The tips you sharing is so helpful
thanks a lot
Cheap GW2 gold
GW2 Gold