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
6. In the Next dialog, select the Database which you are planning to use, I will select the Employees database.
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.
8. Select the Database objects which you want to map in your Model.
9. Once you finish the Steps in the Wizard you can see the Model diagram as follows.
10. That’s it we have added an ADO.Net Entity Data Model to our Project.
Related Post
Concepts
ADO.NET Entity Framework
ADO.NET Entity Framework Architecture
Entity Data Model
LINQ To SQL Vs ADO.Net Entity Framework
Programming
ADO.Net Entity Data Model Prerequisite
Creating your First ADO.Net Entity Data Model
Selecting Data using ADO.Net Entity Framework
Selecting Data by Joining Tables using ADO.Net Entity Framework
Inserting Data using ADO.Net Entity Framework
Inserting Data with Foreign Key Reference using ADO.Net Entity Framework
Updating Data using ADO.Net Entity Framework
Updating Data with Foreign Key Reference using ADO.Net Entity Framework
Deleting Data using ADO.Net Entity Framework
10. That’s it we have added an ADO.Net Entity Data Model to our Project.
Related Post
Concepts
ADO.NET Entity Framework
ADO.NET Entity Framework Architecture
Entity Data Model
LINQ To SQL Vs ADO.Net Entity Framework
Programming
ADO.Net Entity Data Model Prerequisite
Creating your First ADO.Net Entity Data Model
Selecting Data using ADO.Net Entity Framework
Selecting Data by Joining Tables using ADO.Net Entity Framework
Inserting Data using ADO.Net Entity Framework
Inserting Data with Foreign Key Reference using ADO.Net Entity Framework
Updating Data using ADO.Net Entity Framework
Updating Data with Foreign Key Reference using ADO.Net Entity Framework
Deleting Data using ADO.Net Entity Framework
1 comment:
The tips you sharing is so helpful
thanks a lot
Cheap GW2 gold
GW2 Gold
Post a Comment